We just got in pointers in my class, and i am facing some difficulties in understanding them.
Here's the code with the problem:
Code:
#include <stdio.h>
main()
{
int *p;
int k = 5;
p = &k;
printf( "%p, p* = %d, p+1 = %p, %d ", p, *p, p+=1, *p );
}
What i expect this programm to do is write firstly the address of p, then 5, then the new adress and then a number i don't know in advance.
However the programm prints the adress, then the number i don't know in advance then the new adress and then 5.
Why?
Thx - Polor