I am working with a new program of and it is a large size. I need to have variables that do not go out of scope after each function. The problem with global variables is that they are used in the whole program. I am separating the functions into small namespaces though, and I declare variables in the namespaces and they don't seem to go out of scope or affect the whole program. Can anyone give me advice on if this is a good idea and some of the bad effects, if any, of doing this is. Thank you.
Bad idea. Just the fact that you can apparently group them together into namespaces makes it likely that the majority of your variables should be part of appropriate classes.