const int myAge = 70;
extern const int myAge;
secondFile.cpp
const int myAge = 30; // isn't it a duplicate symbol? Without "const" it is a a duplicate symbol!
extern const int myAge = 25; // well, it links fine but what's the point of "external" then? We can't access "myAge" from "main.cpp"!
const
extern
// main.cpp extern const int myAge = 70; // secondFile.cpp extern const int myAge;
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)