   Header files question
  I got game.h and game.cpp files. In the header .h file I got prototypes of my functions. What about global variables. Is it better to keep them in .h file or .cpp. When I put them in .h file I had a linker error saying that those vars have already been declared.   
Organizing source files in C++. You (for all practical purposes) can't define the variables in a header. You must define them in exactly one translation unit; in a header they will appear in more than one, potentially. So define them in a single source file and extern them in a common header.However, it is possibly more ideal for you to remove the need for global variables entirely.[Edited by - jpetrie on June 29, 2009 1:37:08 PM];  Wow, that was an insta answer, thanks.