I have a public class member using a global variable and its causing my program to crash. How would I use the global variable since its not in my class member? I was thinking by using a pointer but I am not sure how to use pointers correctly.
I have a public class member using a global variable and its causing my program to crash. How would I use the global variable since its not in my class member? I was thinking by using a pointer but I am not sure how to use pointers correctly.
Knowledge is power and I want it all
-0RealityFusion0-
You will have to be more specific, and provide some code. Syntactically, you'd use a global in a class member function the same way you would anywhere else.
Of course, it is a really bad idea to do such a thing. Multiple instances of your class presumably exist, and they can modify the value at any time, invalidating what other instances had done. It becomes nearly impossible (and unnecessary) to guard your variable.
So, post some code, post some more details about what is happening, and post a description of what you are trying to accomplish. Someone will be along to help you find a better solution.
Cheers
The word rap as it applies to music is the result of a peculiar phonological rule which has stripped the word of its initial voiceless velar stop.