Same endian concepts comes into picture but some 1 explain why obj.ch[0] =
-1 not 255 ??
Code -
#include <stdio.h>
int main()
{
union s
{
int i;
char ch[2];
};
union s obj;
obj.i=255;
printf("%d %d %d\n",obj.i,obj.ch[0],obj.ch[1]);
}
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.