@Akshata: Whenever you increase any variable then it increases according to its type. Here the address of array 'a' is being increased.( &a+1 ). so the address of 'a' will temporarily increased to 20 bytes and then that is assigned to ptr. so ptr is now pointing to any value in the memory just after the memory where 5 is stored. so when we print ptr[-1] it prints "5".
I think it should be clear now. if not,plz let me inform. -- 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.
