Ok, weird question time!
I am refactoring old C ++ code that declares a bunch of arrays like this:
static SomeStruct SomeStructArray[] = { {1, 2, 3}, {4, 5, 6}, {NULL, 0, 0} }
Etc. They are scattered around the source files and are used where they are declared.
However, I would like to move them to a single source file (mainly because I came up with a way to automatically generate them). And of course, I naively try to make a headline for them:
static SomeStruct SomeStructArray[];
Actually, even I know this incorrectly, but here is a compiler error:
error C2133: 'SomeStructArray' : unknown size arrays.h error C2086: 'SomeStruct SomeStructArray[]' : redefinition arrays.cpp
So, I think, what is the right way to do this?
source share