title: Experiments using sizeof with arrays and pointers
body: <p>For the program :</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(void)
  {
  
      int (*a)[2];
      int b[5];
  
      printf("sizeof(int) : %zu\n", sizeof(int)); 
      printf("sizeof(int*) : %zu\n", sizeof(int*));
  
      printf("sizeof(b) : %zu\n",sizeof(b));
      printf("sizeof((int*)b) : %zu\n",sizeof((int*)b));
      printf("sizeof(&amp;b[0]) : %zu\n",sizeof(&amp;b[0]));
  
      printf("sizeof(a) : %zu\n",sizeof(a));
      printf("sizeof(a[0]) : %zu\n",sizeof(a[0]));
      printf("sizeof(a[1]) : %zu\n",sizeof(a[1]));
  
      return 0;
  }
  </code></pre>
  
  <p>Output is :</p>
  
  <pre><code>sizeof(int) : 4 -&gt; Fact 1
  sizeof(int*) : 8 -&gt; Fact 2
  sizeof(b) : 20 -&gt; Case 1
  sizeof((int*)b) : 8 -&gt; Case 2
  sizeof(&amp;b[0]) : 8 -&gt; Case 3
  sizeof(a) : 8 -&gt; Case 4
  sizeof(a[0]) : 8 -&gt; Case 5
  sizeof(a[1]) : 8 -&gt; Case 6
  </code></pre>
  
  <p>Questions/Observations (in Case Order ) :</p>
  
  <ol>
  <li><p>Is Case 1 output 20 because <code>b</code> was declared as an array of integers ie <code>int[]</code>? The total block in bytes is returned as confirmed by Fact1. Isn't it?</p></li>
  <li><p>I guess casting <code>b</code> to <code>int*</code> made the difference here. Here <code>b</code> is 
  considered a pointer. I confirmed this using Fact2. Right or wrong?</p></li>
  <li><p><code>&amp;b[0]</code> decays to a pointer <code>b</code>. The output coincides with Fact2 .</p></li>
  <li><p>I <strong>expected</strong> 16 here but I got 8 as the output. I concluded that this is because <code>a</code> is afterall a pointer and the output coincides with Fact2 . I got the output similar to Question 2. </p></li>
  <li><p><code>a[0]</code> is pointer. The output coincides with Fact2</p></li>
  <li><p><code>a[1]</code> is pointer. The output coincides with Fact2</p></li>
  </ol>
  
  <p>Please answer the questions and correct me if any of the observations are wrong.</p>