title: Question regarding size of integer pointer variables in C
body: <p>I wrote this really simple program to check the size of integer pointers in c.</p>
  <pre><code>#include &lt;stdio.h&gt;
  
  int main(void) {
      
      int i = 10;
      int* i_ptr = &amp;i;    
      int arr[3] = {13, 14, 15};
  
      printf(&quot;\n ... Size of an integer pointer is: %ld bytes and %ld bits ...&quot;, sizeof(i_ptr), 8*sizeof(i_ptr));    
      printf(&quot;\n\n ... Size of a 3-element integer array is: %ld bytes and %ld bits ...\n\n&quot;, sizeof(arr), 8*sizeof(arr));
      printf(&quot; ... Size of the *arr element is: %ld bytes and %ld bits ...\n\n&quot;, sizeof(*arr), 8*sizeof(*arr));
  
      return 0;
  }
  </code></pre>
  <p>The output regarding the size of the different variables was:</p>
  <pre><code>... Size of an integer pointer is: 8 bytes and 64 bits ...
  
  ... Size of a 3-element integer array is: 12 bytes and 96 bits ...
  
  ... Size of the *arr element is: 4 bytes and 32 bits ...
  </code></pre>
  <p>Now, my questions is the following. As I am running a 64-bit linux operating system, I understand that the size of an integer pointer variable is 64 bits long. The size of the integer array is 12 bytes since an integer takes 4 bytes of memory and the array consist of 3 integers. However, when I think that an array is basically a pointer in C and the variable of the array points to the first element of the array, I supposed that the size of the array would resemble the size of the corresponding pointers. Yet, I also understand that this wouldn't mean that the size of the array would be 24 bytes long as the size of 3 integer pointers. This seems kind of confusing to me, so any advice would be appreciated.</p>