title: Size of array in C/C++
body: <p>Consider the following code:</p>
  <pre><code>int main(){
      int arr[] = {1,2,3,7,8};
      int size = sizeof(arr);
      cout &lt;&lt; size;
  }
  </code></pre>
  <p>I know that the above code will print the size of the array which is 4*5 = 20 bytes but i have a small doubt in this, <code>arr</code> is a pointer to the first element in the array and the size of a ptr variable is 4 bytes so why it does not print out 4 in the console?</p>
  <p>Even when we dereference <code>arr</code> and print it, the first element in the array will be printed.</p>
  <pre><code>cout &lt;&lt; *arr;
  </code></pre>
  <p>So how does this <code>sizeof()</code> operator work in case of arrays??</p>