File 1:
static char* const path; //GLOBAL
int main()
{
path = FunctionReturningPath();
UsePath()
}
File 2:
extern char* const path; //GLOBAL from file 1
UsePath() //function using global
{
something = path;
}
(Pseudo)
Would like to use path in file 2.
I'm defining the global within main in file 1, is that bad practice using a global?
and doesn't compile:
Compile Error: error LNK2001: unresolved external symbol _path
Any help is appreciated. Thank You.