#include<stdio.h>

int main()
{
    int a[5] = {1,2,3,4,5};
    int *p = &a;
    p=p+1;;
    printf("%d",*(p));
    getch();
    return 0;
}

After p=p+1, p should point to the next byte after 5, but output in this 
case 2. That is p is just travelling inside the array. Is thr any diff b/w 
incrementing while initializing and that done aftrwrds?

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/algogeeks/-/lHFcUUxZ-gMJ.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to