Global variable in C oO
Posted: Sun Jan 18, 2009 12:07 am
Hello people!
I hate globals (and this is probably the reason I like C++), but I need them. I know that if I want function not to be accessible outside of .C file, I would declare it static, what about variable? Variable declared either static or not in .C file wont be accessible outside of the file, But what the real difference between global static and non-static (and please don't tell me to go learn C or something else, I know what is static, I never used it as a global variable).
Thanks.
I hate globals (and this is probably the reason I like C++), but I need them. I know that if I want function not to be accessible outside of .C file, I would declare it static, what about variable? Variable declared either static or not in .C file wont be accessible outside of the file, But what the real difference between global static and non-static (and please don't tell me to go learn C or something else, I know what is static, I never used it as a global variable).
Thanks.