At todays class, we were doing some tasks with pointers. So here's the thing.
Program:
1 2 3 4 5 6 7 8 9 10
#include <stdio.h>
int main()
{
int a[] = {1,0}, *p;
p = a;
printf("%d,",*p++);
printf("%d\n",*p);
return 0;
}
In my point of view, it should write down: 0,0 but it doesnt(1,0 is the result). Teacher had the same problem as im having now and he couldnt say why is it doing that way. My opinion, it should go from right to left(first ++ operator, then gets value of *p in printf). So, if someone knows how to explane it to me it would be great.