title: Need help in understanding left shift operator in C
body: <p>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.</p>
  
  <p>But consider this program:</p>
  
  <pre><code>int a=4,*pA=&amp;a,r3;
  printf("%d\n",pA);
  printf("%d\n",(*pA&lt;&lt;2));
  r3=pA-(*pA&lt;&lt;2);
  printf("%d",r3);
  </code></pre>
  
  <p>It prints out pA, and (*pA&lt;&lt;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&lt;&lt;2), and their subtraction doesn't equal to what it's supposed to.</p>
  
  <p>Any help is appreciated...</p>
  
  <p>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.</p>