hey guys
can someone give me an example of a 2D array because i need to use to in my assignment and i just found out that its not the same case as an array with one variable. how can i initialize it? how can i use it?
thanks in advance :)
#include <iostream>
int main()
{
const size_t M = 10;
const size_t N = 20;
int a[M][N] = {};
for ( constauto &row : a )
{
for ( int x : row ) std::cout << x << ' ';
std::cout << std::endl;
}
return 0;
}