#include <iostream>
#include <array>
int main (){
const size_t m = someInt;//the outer dim
const size_t n = anotherOne;//the inner one
std::array<std::array<int, m>, n> myArray;//it's an array containing m arrays
// each one of them has n integers
for( size_t i{}; i < m; ++i)
for (size_t j=0; j < n; j++){
myarray[ i ] [ j ] = fillIt;
}
}
If u want to use an initializer list, you can use it as follows
std::array myArray{std::array{5,6},std::array{7,8}};//c++17
std::array<std::array<int, 2> > myArray{std::array<int, 2>{5,6},std::array<int, 2>{7,8}};
Note that the last initialization initializes the array with two temporary arrays each one of them has 2 int
elements