This is more of a question in C than C ++, but:
void f(int n);
Declares a function f that takes a single integer parameter.
extern void f(int n);
Declares a function f that takes a single integer parameter, but exists in some other file. The compiler will trust that you have implemented the function somewhere. If the linker cannot find it, you will get a linker error.
static void f(int n);
Declares a function f that takes a single integer parameter. The static keyword makes this interesting. If it is a .cpp file, the function will be visible only to this file. If it is in the .h file, each .cpp file containing this header will create its own copy of this function, available only for this implementation file.
source share