I have a few issues understanding the left shift operator. I know that if shifts by x amount of bits to the left, therefore pretty much multiplying the number to 2 to the power of the number of bits shifted.
But consider this program:
int a=4,*pA=&a,r3;
printf("%d\n",pA);
printf("%d\n",(*pA<<2));
r3=pA-(*pA<<2);
printf("%d",r3);
It prints out pA, and (*pA<<2) separately, and if you were to subtract these two, it won't equal to the r3 written in the expression, being off by 4 times, which is the size of int. But where do you need to take the size of int into consideration, since you have both pA and (*pA<<2), and their subtraction doesn't equal to what it's supposed to.
Any help is appreciated...
For the record, I am not interested in printing out the actual value of the pointer, but actually its address being shifted by 2 bits. And I don't understand the exact process that is happening.