P
polas
I have a quick question - I have used extern quite a bit in relation
to variables, however was wondering if its applicable to function
prototypes too?
For instance, I have a file called a.c - a small snapshot of it
contains
extern int a;
void hello(int);
Then in a file called e.c, a small snapshot I have
int a;
void hello(int num)
{
.....
}
These two C files are linked together during compilation, but is there
any reason to add extern in front of the hello function prototype in
a.c (or would adding this not conform to the standard.) On my C
compiler (gcc) it doesnt complain when I add extern in this way, but
doesnt seem to do a huge amount.
Cheers,
Nick
to variables, however was wondering if its applicable to function
prototypes too?
For instance, I have a file called a.c - a small snapshot of it
contains
extern int a;
void hello(int);
Then in a file called e.c, a small snapshot I have
int a;
void hello(int num)
{
.....
}
These two C files are linked together during compilation, but is there
any reason to add extern in front of the hello function prototype in
a.c (or would adding this not conform to the standard.) On my C
compiler (gcc) it doesnt complain when I add extern in this way, but
doesnt seem to do a huge amount.
Cheers,
Nick