P
person
Hi,
I've got a global variable, type * var_name, declared in one .cpp file.
I assign it a value inside one of the methods in that file. I extern
it in other .cpp files. For some reason in all the other files it's
NULL (thus causing my program to crash when I try to use it). I know
it's getting assigned a legitimate value because I can use it
successfully in the method right after it's assigned. The declaration
is not static. Will someone please tell me what I'm doing incorrectly?
It was working, then I had to go through a major overhaul of my
including of .h files due to a bizarre inheritance problem. Now it
doesn't work and I don't know if it's a side effect of the include
exercise or if something else has gone haywire. Any help/ideas would
be greatly appreciated.
Thanks,
Frank
I've got a global variable, type * var_name, declared in one .cpp file.
I assign it a value inside one of the methods in that file. I extern
it in other .cpp files. For some reason in all the other files it's
NULL (thus causing my program to crash when I try to use it). I know
it's getting assigned a legitimate value because I can use it
successfully in the method right after it's assigned. The declaration
is not static. Will someone please tell me what I'm doing incorrectly?
It was working, then I had to go through a major overhaul of my
including of .h files due to a bizarre inheritance problem. Now it
doesn't work and I don't know if it's a side effect of the include
exercise or if something else has gone haywire. Any help/ideas would
be greatly appreciated.
Thanks,
Frank