How to get across pointers?
Here is a little piece of code that i am unable to understand
int x=30, *y, *z;
y=&x;
z=y;
//y++ = z++;
//*y++ = *z++;
x++;
printf("x=%p, y=%p, z=%p y=%p\n ", &x, y,z,y++);
return 0;
These doubts are haunting me:
why is (z++ = y++;) invalid assignment while (z = y) valid. what does this
assignment (*y++ = *z++) mean?
Furthermore, if I run this program i am getting following output:
x = 0028FF04 , y = 0028FF08, z = 0028FF04 y = 0028FF04
while my expectation is
x = 0028FF04 , y = 0028FF04, z = 0028FF04 y = 0028FF08
No comments:
Post a Comment