As we know size of int data type is 2 bytes
or 4 bytes
depend on your system. While char
pointer point one byte at a time.
Memory representation of int a = 300;
So, char
pointer p
pointing to only first byte as show above figure.
So, first time print 44 output.
Then,
printf("%d",*++p);
first p
is increment and pointer point to next(second) byte. So, next byte output is 1
.
2
solved Pointers outputs confusing me