|
-
Mar 29th, 2001, 01:23 PM
#1
Thread Starter
Frenzied Member
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?
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Mar 29th, 2001, 01:47 PM
#2
Monday Morning Lunatic
It's still a global, but you can only access it if you have a definition -- for example using extern.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 29th, 2001, 01:50 PM
#3
Thread Starter
Frenzied Member
Right but I only wanted that VAR to accessed by the functions in this cpp, thats why I did not extern it.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Mar 29th, 2001, 01:55 PM
#4
Monday Morning Lunatic
Since by default they're only file-global if defined at file scope (not inside a function or namespace), just call it global
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 29th, 2001, 02:02 PM
#5
Thread Starter
Frenzied Member
Thats the conclusion I came to, I just thought there might be another name for it like, Locally Global, or something
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

-
Mar 29th, 2001, 02:05 PM
#6
Monday Morning Lunatic
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.
I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
-- Linus Torvalds
-
Mar 29th, 2001, 02:08 PM
#7
Thread Starter
Frenzied Member
Hmm...Yeah I like that. That should work fine.
Thanks.
MSVS 6, .NET & .NET 2003 Pro
I HATE MSDN with .NET & .NET 2003!!!
Check out my sites:
http://www.filthyhands.com
http://www.techno-coding.com

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|