MyClass.h
class MyClass { public: static const int cTotalCars; private: int m_Cars[cTotalCars]; };
MyClass.cpp
I would rather use a #define C_TOTAL_CARS 5, then static const int cTotalCars = C_TOTAL_CARS; and then also, int m_Cars[C_TOTAL_CARS];.
#define C_TOTAL_CARS 5
static const int cTotalCars = C_TOTAL_CARS;
int m_Cars[C_TOTAL_CARS];