title: How are array and pointer types handled internally in C compilers? ( int *a; vs. int a[]; )
body: <p>I need a language lawyer with authoritative sources.</p>
  
  <p>Take a look at the following test program which compiles cleanly under gcc:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  
  void foo(int *a) {
      a[98] = 0xFEADFACE;
  }
  
  void bar(int b[]) {
      *(b+498) = 0xFEADFACE;
  }
  
  int main(int argc, char **argv) {
  
  int a[100], b[500], *a_p;
  
  *(a+99) = 0xDEADBEEF;
  *(b+499) = *(a+99);
  
  foo(a);
  bar(b);
  
  printf("a[98] == %X\na[99] == %X\n", a[98], a[99]);
  printf("b[498] == %X\nb[499] == %X\n", b[498], b[499]);
  
  a_p = a+98;
  *a_p = 0xDEADFACE;
  
  printf("a[98] == %X\na[99] == %X\n", a[98], a[99]);
  
  }
  </code></pre>
  
  <p>It produces the output I expect:</p>
  
  <pre><code>anon@anon:~/study/test_code$ gcc arrayType.c -o arrayType
  anon@anon:~/study/test_code$ ./arrayType 
  a[98] == FEADFACE
  a[99] == DEADBEEF
  b[498] == FEADFACE
  b[499] == DEADBEEF
  a[98] == DEADFACE
  a[99] == DEADBEEF
  </code></pre>
  
  <p>Are a and b the same type?  Is <code>int *a</code> handled as the same type as <code>int a[]</code> internally in the compiler?  </p>
  
  <p>From a practical point of view <code>int a[100], b[500], *a_p, b_a[];</code> all seem to be the same type.  It's hard for me to believe that the compiler is constantly <em>adjusting</em> these types in the various circumstances in my above example.  I'm happy to be <em>proven</em> wrong.</p>
  
  <p>Can someone settle this question for me <strong><em>definitively and in detail</em></strong> ?</p>