title: use of sizeof operator
body: <p>The output of  following program</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  int main(){
      int *p[10];
      printf("%ld %ld\n",sizeof(*p),sizeof(p));
  }
  </code></pre>
  
  <p>is </p>
  
  <pre><code>8   &lt;--- sizeof(*p) gives  size of single element in the array of int *p[10] 
  80  &lt;--- sizeof(p) gives  size of whole array which is 10 * 8 in size.
  </code></pre>
  
  <p>now see  the following program </p>
  
  <pre><code> #include&lt;stdio.h&gt;
   #define TOTAL_ELEMENTS (sizeof(array) / sizeof(array[0]))
   int array[] = {23,34,12,17,204,99,16};
  
    int main()
    {
        int d;
        printf("sizeof(array) = %ld \n",sizeof(array));
        printf("sizeof(array[0]) = %ld \n",sizeof(array[0]));
        printf("sizeof int %ld\n",sizeof(int));
        printf("TOTAL_ELEMENTS=%ld \n",TOTAL_ELEMENTS);
        for(d=-1;d &lt;= (TOTAL_ELEMENTS-2);d++)
            printf("%d\n",array[d+1]);
  
        return 0;
    }
  </code></pre>
  
  <p>is</p>
  
  <pre><code>sizeof(array) = 28 
  sizeof(array[0]) = 4  &lt;--here
  sizeof int 4
  TOTAL_ELEMENTS=7 
  </code></pre>
  
  <p>What I am not able to understand is why is the sizeof(array[0]) different in both the outputs.</p>