There is such code:
#include <iostream>
extern void fun();
int main(){
fun();
return 0;
}
void fun(){ std::cout << "Hello" << std::endl; }
Is there some difference between declarations:
extern void fun();
void fun();
? Code above behaves the same with extern and without extern keyword.
Function declarations do have external linkage by default, so adding the extern
keyword to a function declaration makes no difference, it is redundant.
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