-
Ok this is a strange question that CyberCartsen and I have been discussing and we have not figured it out. I was wonder if some one else knew this. Or if anyone else even does these types of VARs.
Its about VARs that are not local, and not really global. Example:
a .h file
PHP Code:
...
extern int GlobalVar;
void whateverfunction();
...
a .cpp file
PHP Code:
...
int GlobalVar;
int notreallyGlobal; //This is VAR at hand
void whateverfunction()
{
int LocalVar;
}
...
Ok now GlobalVar is of course a Global VAR through out your program. LocalVar is of course a Local VAR in that function. So what is notreallyGlobal called since it is only Global in that cpp? Is it still called Global?
-
It's still a global, but you can only access it if you have a definition -- for example using extern.
-
Right but I only wanted that VAR to accessed by the functions in this cpp, thats why I did not extern it.
-
Since by default they're only file-global if defined at file scope (not inside a function or namespace), just call it global :)
-
Thats the conclusion I came to, I just thought there might be another name for it like, Locally Global, or something
-
Well, I've never heard them called anything different, so I don't know if there's a real name for them...although if you called them File Global people would probably know what you meant.
-
Hmm...Yeah I like that. That should work fine.
Thanks.