- Aug 4, 2001
- 967
- 0
- 0
I may be just completly lost, but I'm unable to declare a global variable that would be used across several classes!
I tried declaring it in a header file that my classes share, but I get linking errors saying the variable has already been defined (even if I included commands like #ifndef TITLE_H #define TITLE_H at the beginning of my header file).
If I declare it static, it will link, but the value of the variable doesn't seem to stay put across my classes (checked that by debugging).
Anyway way to declare a global variable that would be visible everywhere??
thanks guys!
I tried declaring it in a header file that my classes share, but I get linking errors saying the variable has already been defined (even if I included commands like #ifndef TITLE_H #define TITLE_H at the beginning of my header file).
If I declare it static, it will link, but the value of the variable doesn't seem to stay put across my classes (checked that by debugging).
Anyway way to declare a global variable that would be visible everywhere??
thanks guys!