I'm simply trying to print the first seven rows of a two dimensional array. Whats wrong with my code?
I keep getting the seven rows in one long row instead of their own individual rows. Everything I've googled/read leads me to believe that my code is correct, but it still doesn't work. I've tried using \n and endl;, but that sends it down, each integer on its own line instead of the lines ending at 15.
//these are the declarations
int row = 12;
int col = 15;
int someArray[row][col];
for (row = 0; row < 12; row++)
for (col = 0; col < 15; col++)
someArray[row][col] = col;
//this is where my problem is
for (int row = 0; row < 7; row++)
for (int col = 0; col < 15; col++)
cout << someArray[row][col] << " "
I need the output to be the first seven rows of this array, separated into their respective lines of output, but upon compilation and execution, the output is one long line of these seven rows.