Originally Posted by citizen
> ok, I don't understand it
The whole point of the extern keyword is to extend a variable's lifespan beyond file scope. It allows global constants to exist across an entire project.
Vart's quote from the standard states that constants are linked internally in C++ by default, allowing you to initialize a constant in a header file. In the language's predecessor, C, constants weren't allowed to be initialized in header files, so extern was used. C++ supports the extern keyword because it was inherited from C. If someone can prove that a constant must or shall be linked internally, then I'll gladly shut up.