Quote:
Originally Posted by Phazonmutant
I've been wondering what the keyword extern does.
|
It basically tells the compiler "This is the name of something that is defined in a separate file. You don't need to know any more details about it at the present time. Make sure to put the appropriate placeholder information in the object file so that things can be linked together correctly later."
The
extern "C" gives a hint to the compiler that the separate file will be using C conventions, so the linker doesn't get confused trying to connect C and C++ object files together without the appropriate conversion.