title: External Delaration for An Array?
body: <p>I have an array defined in a file and in another I have to use it, for e.g-</p>
  
  <pre><code>/* a.c - defines an array */
  
  int a[] = {1,2,3,4,5,6,7,8,9}; 
  
  
  /* b.c - declare and use it. */
  
  #define COUNT ((sizeof a)/(sizeof int))
  extern int a[];  //size of array
  
  .
  .
  .
  
  int i;
  for(i=0; i&lt;COUNT; i++)
    printf("%d", a[i]);
  .
  .
  .
  </code></pre>
  
  <p>Now when I try to compile it it gave me error saying that sizeof cann't be used on incomplete type.</p>
  
  <p>Can anybody tell me how to handle such case in C/C++? I don't want to array subscript in a.c</p>
  
  <p>Thanks in advance</p>