Why should I use "extern" for function declaration in C? -
this question has answer here:
- effects of extern keyword on c functions 8 answers
i wondering if there difference if skip extern
storage class specifier while declaring function? specifically, there difference between following two?
void foo ();
and
extern void foo();
is there difference between following two?
basically, no.
each function declaration, extern
default, (i.e., in absence of specific storage-class specifier).
quoting c11
, chapter §6.2.2, linkages of identifiers
if declaration of identifier function has no storage-class specifier, linkage determined if declared storage-class specifier
extern
.
Comments
Post a Comment