|
|
|
|
|
by 20k
15 days ago
|
|
The C++ way to do it currently would be: std::array<std::array<T, N>, M> data;
Which is contiguous int data[M][N];
also works fine and is contiguous in C++Edit: For the stack at least. On the heap, you'd need to use a single std::vector<int> and do the indices manually, or use mdspan |
|
It works fine in C though, or FORTRAN, or Ada, or ALGOL 60, ...