0 will be typecasted into int pointer giving 0th memory location and then adding 1 to that location will be 4 (moving to the next immediate address of integer pointer coz size of integer pointer is 4 byte on 32 bit machines) according to integer pointer arithmatic. so when memory location is again typecasted into int giving integer value of that location. If u were using 64 bit system answer would be 8.
On Sun, Jun 10, 2012 at 2:23 PM, Anika Jain <[email protected]> wrote: > printf("%d\n", (int) ((int*)0 +1)); its prints no. of bytes in integer. > > please explain what does this mean? what and how is happening in this? > > -- > Regards > Anika Jain > > -- > 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. -- 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.
