In your printf you are extracting the value in pos 1, increasing the position with +1 from 0 .
In the second integer, you extract 5 , because &a+1 actually points outside the array, so when you do *(ptr-1) , it returns 5 . If you delete -1 , you will get a really strange result (in my case it was -1078772784 ).
user195488
source share