Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C > Re: little/big ...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 6 Topic 26050 of 26972
Post > Topic >>

Re: little/big endian question.

by Willem <willem@[EMAIL PROTECTED] > May 3, 2008 at 02:34 PM

Charles wrote:
)
) Suppose I have this code:
)
)   unsigned short svalue;
)   unsigned char  hibyte, lobyte;
)
)   svalue = 0xABCD;
)
)   hibyte = (svalue >> 8) & 0xFF;
)   lobyte = svalue & 0xFF;
)
) Will this result in the values of hibyte and lobyte being 0xAB and 0xCD
) respectively, regardless of whether the platform is little or big
endian?

Of course it will.  The ****ft operator doesn't care about endianess.


SaSW, Willem
-- 
Disclaimer: I am in no way responsible for any of the statements
            made in the above text. For all I know I might be
            drugged or something..
            No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
 




 6 Posts in Topic:
little/big endian question.
Charles Sullivan <cwsu  2008-05-03 14:29:24 
Re: little/big endian question.
Willem <willem@[EMAIL   2008-05-03 14:34:25 
Re: little/big endian question.
vippstar@[EMAIL PROTECTED  2008-05-03 09:21:28 
Re: little/big endian question.
Charles Sullivan <cwsu  2008-05-03 14:45:05 
Re: little/big endian question.
Martin <martindotounde  2008-05-04 20:27:40 
Re: little/big endian question.
Ben Bacarisse <ben.use  2008-05-04 22:00:21 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 16:00:30 CDT 2008.