Hi Kiran,
Looks like you are struggling with basic C programming here, and the compiler is correct to flag what you did.
Using 'extern' is a *declaration*, i.e. it makes the symbol known to the compiler.
use something like
extern int q[7200];
is fine.
It is *not* ok in C to initialize a declaration like you did with
extern int q[7200] = {0};
as you mix up a declaration and a definition:
- declaration: makes the type/name of the variable known to the program
- definition: defines and allocates the memory for the variable.
So you should use
extern int q[7200];
for example in the header file.
And in a C file (only there) you make the definition of it with
int q[7200] = {0};
and as this is the definition, you can initialize it.
So one message from the compiler is that you should not initialize a declaration, the other message is that you only had a declaration, but no definition.
I hope this makes sense,
Erich