<<< | Index | >>> |
Older compilers (think older C++ programs) may not support initialization of integral static variables in declaration.
The usual external static member initialization compiles fine, but still can't be used for array sizes.
Use the "enum hack" instead:
class IntStack { enum { STACK_SIZE = 1024 }; // nameless enum int m_stack[ STACK_SIZE ]; // works fine! };
<<< | Index | >>> |