title: How to declare a global variable in C++
body: <p>I know one should not use global variables but I have a need for them. I have read that any variable declared outside a function is a global variable. I have done so, but in another <code>*.cpp</code> file, that variable could not be found. So it was not really global. Isn't it so that one has to create a header file <code>GlobalVariabels.h</code> and include that file to any other <code>*cpp</code> file that uses it?</p>