I need help with a pointer declaration, I have several classes with arrays of pointers eg.
const char* const clsMainWin::mcpszXMLattrRoot[] = {"bottom","left","right","top",NULL};
const char* const clsMainWin::mcpszXMLattrA[] = {"x","y","z",NULL};
What I want to do is define a pointer which groups the above arrays of pointers allowing me to select one of the about with a single index, eg:
const char* const allOptions[] = {mcpszXMLattrRoot, mcpszXMLattrA};
Where:
allOptions[0][...] would be used to access mcpszXMLattrRoot and its contents:
allOptions[1][...] would be used to access mcpszXMLattrA and its contents
However so far I'm struggling to get the declaration of allOptions correct.
mcpszXMLattrRootandmcpszXMLattrAare different types, which means you can't collect them into the same array. The type ofmcpszXMLattrRootisconst char * const [5], while the type ofmcpszXMLattrAisconst char * const [4]. The number of elements in the arrays are part of the type, and an array can only contain elements of the same type.ctag