Hello,
I guess
http://betterexplained.com/articles/understanding-big-and-little-endian-byte-order/
will help you to understand better. Basically the output will depend
on endianess of the system. I guess your machine were you ran this
program is little endiness machine. Let me know if you have any doubt.
~Viswanath.
On May 20, 8:19 pm, siva viknesh <[email protected]> wrote:
> main()
> {
> int i = 257;
> int *iPtr = &i;
> printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );}
>
> Answer:
> 1 1
>
> main()
> {
> int i = 258;
> int *iPtr = &i;
> printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );}
>
> Answer:
> 2 1
>
> ..can anybody explain how??
> --
> Regards,
> $iva
--
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.