Amazon ..!! :) &a increments by whole array not just an int value..!! u marked 2 1 ??
On Sat, Jul 23, 2011 at 6:03 PM, Akshata Sharma <[email protected]>wrote: > main() > { > int a[5] = {1,2,3,4,5}; > int *ptr = (int*)(&a+1); > > printf("%d %d" , *(a+1), *(ptr-1) ); > } > > output: 2 5 > > can someone please exlplain how we are getting 5? > > -- > 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.
