wow your all over the map for programming languages!
I can't really offer any code, but I have a few ideas here.
First thing, I thought of, was a multidimensional array:
int table[5][5];
this obviously won't work, only 36 items, and can't be resized.
I'm not familar with the whole semantics of C, but it might be possible using an Array of an Array of pointers:
typedef struct {
int[]* value
} TableDef;
TableDef[]* deftable;
I highly doubt I got that in the first try, but the idea is to make an array of an Array of Pointers to Arrays, (obviously you won't just be storing int types, but that's easy to change.
I'm not 100 percent on how one would access it either, my experience with the indirection operator has been unpleasant at best. And don't get me started on const parameters...
deftable=malloc(SizeOf TableDef*5)
for (int i =0;i<5;i++)
detable[i]*->value=malloc(SizeOf int*50);
which would create a 2 by 50 table (again, this is just off the top of my head, more for ideas then usable code....)
then, accessing would be something like:
deftable[2]*->value[5]=12;
Since your using C++, it might be better to do this using classes.
I've had terrible results with anything dynamic in C/C++. its the pointers that always get me, I think. I can deal with pointers in VB6 but they are always long variables, and "dereferencing" the variables means I have to explicitly use "copymemory" to a new variable, so I always know what's what.