Global Variables in C++... not as easy as it seems