Wrong use of increment in pointers


#include <stdio.h>
int main (void)
{
    int *i,j;
    i=&j;
    j=10;
    printf("%d\n",i);
    *i++;
    printf("%d\n%d\n",j,i);
    return 0;
}



The output is given below:

2293616
10
2293620

0 comments:

Post a Comment