I\'ve having difficulty understanding how \'extern\' works. I\'ve searched Google but there doesn\'t seem to be the particular example case I\'m trying
If i have a f
In C++, like C before it, each source file is compiled to an object file. Then all the object files are linked to create the executable program.
To share symbols (functions, global variables), there are several keywords that tell the compiler which are local to the file, which are private, and which are imported from other file.
The `extern' keyword means that a symbol can be accessed, but not defined. It should be defined (as a global) in some other module. If not, you get an 'undefined symbol' error at link time.