Posted by Acid-Chris
on 23 November 2012 - 02:55 AM
First of all, in your Constants.cpp file you need to write "const int MAX_INTS = 1000; "
The extern keyword means "declare without defining". In other words, it is a way to explicitly declare a variable, or to force a declaration without a definition.
The practice itself (putting the initialization into the cpp file) is a matter of personal taste. I personally like it because if i need to change the value for whatever reason, not every single file which includes the header file is compiled again.
But i wouldnt use "extern" anymore....i like static const uint32 MAX_INTS; in a header file more. ;-)