the logic is :- int is stored in 32 bits in our systems 300 is 00000000 00000000 00000001 00101100 as ptr is character pointer, it points to lower 8 bits and when *++ptr=2 gets executed then 00000001 changes to 00000010(equal to 2)
so i becomes 00000000 00000000 00000010 00101100 which is 556 :D On Sun, Feb 6, 2011 at 10:26 PM, aditya pratap <[email protected]>wrote: > @jalaj : gcc compiler. > > -- > 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. > -- With Regards, *Jalaj Jaiswal* (+919019947895) Final Year Undergraduate, IIIT ALLAHABAD -- 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.
