tag:blogger.com,1999:blog-4385671836555623731.post5583778865964579281..comments2023-10-10T09:22:05.553-07:00Comments on TechForb: How to convert an integer to little endian or big endianVishal Jainhttp://www.blogger.com/profile/01516639234852190662noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-4385671836555623731.post-35092079970250989602011-05-27T04:41:47.526-07:002011-05-27T04:41:47.526-07:00maybe, that's the part, where you have to thin...maybe, that's the part, where you have to think yourselves :)Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-19837597395853438762010-10-14T20:34:12.839-07:002010-10-14T20:34:12.839-07:00I had similar problem under MS VC++ when convertin...I had similar problem under MS VC++ when converting byte order for colors from GDI to GDI+. I also chose inline assembler and bswap http://msdn.microsoft.com/en-us/library/ms536255%28v=VS.85%29Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-6472124684289400042010-08-04T05:28:21.538-07:002010-08-04T05:28:21.538-07:00There are x86 asm instruction dedicated to this op...There are x86 asm instruction dedicated to this operation. Wouldn't it be more efficient to use that in stead of doing it like this?Andrehttps://www.blogger.com/profile/01015531365670096405noreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-12344613148346932422009-11-25T06:13:59.039-08:002009-11-25T06:13:59.039-08:00M_D_K IS RIGHT
there should b i++M_D_K IS RIGHT<br />there should b i++nikhil gaikwadhttps://www.blogger.com/profile/12532775801992195484noreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-21288558616928291292009-05-27T15:47:05.587-07:002009-05-27T15:47:05.587-07:00for (i = 0; i < bytes; i )
should be:
for (i...for (i = 0; i < bytes; i )<br /><br />should be:<br /><br />for (i = 0; i < bytes; i++)M_D_Knoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-48452451755163944082009-04-05T08:23:00.000-07:002009-04-05T08:23:00.000-07:00i&7 will be always equal to i, whenever i is l...i&7 will be always equal to i, whenever i is less than or equal to y.<BR/><BR/>So u can replace the i&7 to i.<BR/><BR/>Thanks and Regards<BR/>Khalidkhalidhttps://www.blogger.com/profile/17605766293357400628noreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-30134928737345248622008-06-29T11:55:00.000-07:002008-06-29T11:55:00.000-07:00agreed w/ above commenter. the loop goes on infini...agreed w/ above commenter. the loop goes on infinitely w/o some way for the gap between i and byte to dissapear. i++ or ++i is necessary.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-52978369672877587792008-05-09T13:47:00.000-07:002008-05-09T13:47:00.000-07:00Nope, there is definately a bug in your for loop. ...Nope, there is definately a bug in your for loop. I've compiled and run it and it never exits as i never changes from 0.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-45546433204358446972008-03-25T15:57:00.000-07:002008-03-25T15:57:00.000-07:00above post,you should have a look at bit shifting,...above post,you should have a look at bit shifting,I think...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-4385671836555623731.post-10137671536072555072008-03-24T14:06:00.000-07:002008-03-24T14:06:00.000-07:00fyi, u have a bug in ur FOR loop...'i' never incre...fyi, u have a bug in ur FOR loop...<BR/>'i' never increments.. should be ++i right?Anonymousnoreply@blogger.com