Can anyone tell me why this is printing as a 1-d array rather than a 2 -d? Nevermind im an idiot.
int colls = 5;
int rows = 4;
int array[rows][colls];
for (int x=0; x < rows; x++)
{
for (int g=0; g < colls; g++)
{
array[x][g]=0;
cout <<array[x][g];
}
}
Firstly your array dimensions must be “const”. Secondly you need a endline at the end of the inner loop.