I have an array defined in a file and in another I have to use it, for e.g-
/* a.c - defines an array */
int a[] = {1,2,3,4,5,6,7,8,9};
/* b.c - declare
The compiler does not have enough information when compiling b.c to determine the size of the array. That information is only in a.c where your initializer list is in scope.
You will have to communicate the size somehow. One method is to define an int const with the size and extern that as well. Another possibility would be to use a sentinel (a value outside your valid data range) to indicate the end of the array.