I need to put a static array into a .cpp file. This array is only used in this .cpp so I want to declare it static. The array definition is quite big, so naturally I want to forward declare it.
static int bigIntArray[5000];
/* other code using bitIntArray */
static int bigIntArray[5000] = {
0x00, 0x9900, 0xffee,
...
};
VC 9.0 gives an error: error C2086: 'int bigIntArray[5000]' : redefinition
If I change 'static' to 'extern', the problem goes away but I do not like this solution.
Why I can not forward declare a static variable? Is this required by the C++ standard?