Global variable help
-
Hi,
There are several techniques for that but it's generally discourage. Why do you need that global variable ?
-
I have a person login to an account and then I need to detect which account the person logged into, but the account number is on one cpp file and The place I need to check is on another cpp file, so I need to make a way to acsess the variable from both cpp files
-
Then you should rather look after the singleton pattern
-
Which technique ?
-
Hey ..
Check out the following link:http://stackoverflow.com/questions/3627941/global-variable-within-multiple-files
-
Wrong pattern to use in this case.