When I declare function prototypes in my header-files, I can reach those everywhere in my program, even though I never use the 'extern' keyword. Are they only important for static libraries, or when do I need it?
Functions are extern by default. The extern keyword is only useful for variables.
extern is default storage class specifier in C.
Explicitly specify it on variables
extern int i;
if it can be shared between modules. Then
int i;
in other module will not violate ODR.
For functions yes, pretty useless.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With