Here\'s the deal. I have a static class which contains several static functions used for getting input. The class contains a private static member variable for indicating wh
class Test {
static const int GOOD = 0;
static const int BAD = 1;
};
These are only declarations; they are not definitions. You need to provide definitions of the static member variables, outside of the definition of the class, in one of your .cpp files:
const int Test::GOOD;
const int Test::BAD;
Alternatively, for integer constants, it is often more convenient to use an enum
:
class Test {
enum {
GOOD = 0,
BAD = 1
};
};