Why should I use "extern" for function declaration in C? -


this question has answer here:

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -