Your syntax is simply wrong. Array size goes after the variable name, not the type:
my_struct my_struct_inst[10][10];
Note that the type of my_struct_inst
is still my_struct[10][10]
, that's just the syntax for variable definitions.
With modern C++, I would consider using std::array
instead, though that's not pretty either:
std::array< std:array<my_struct, 10>, 10> my_struct_inst;
This is basically same thing and equally efficient, but it also offers a bunch of nice methods, which may be useful.
To make that easier, you can define it as a type:
using my_struct_10x10 = std::array< std:array<my_struct, 10>, 10>;
my_struct_10x10 my_struct_inst;