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]);


}
o/p :
255 -1 0

But what i expected was 255 255 0
But How that -1 ?
Explain please ?

Thanks
yogeesh serlathan
forum4hackers.blogspot.com