Talk About Network



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 > little/big endi...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 26050 of 26198
Post > Topic >>

little/big endian question.

by Charles Sullivan <cwsulliv@[EMAIL PROTECTED] > May 3, 2008 at 02:29 PM

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?

Thanks for your help.

Regards,
Charles Sullivan




 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 Wed May 14 2:28:28 CDT 2008.