1) you should have the for loop control variables set to numrow and num col (i < numrow) (j < numcol) - (not i <= numrow since the last indice will always be one less than the size) - so you don't have to go back and change them when you change the size of the array
2)
Code:
cin >> grades [numrow][numcol];
You're resetting the same variable which is grades[3][4]. Which is out of the array boundaries. Remember the array of size three has elements [0][1][2].
3) Your'e outputting the Grades[i][j] outisde of the scope of where i and j were declared. You'd have to do another loop to output it.
Here's what I got.
Code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main()
{
const int numrow = 3;
const int numcol = 4;
int grades [numrow][numcol];
for (int i = 0; i < numrow; i++)
{
cout << endl;
for (int j = 0; j < numcol; j++)
{
cout << "enter grades for row # " << (i + 1) << ": ";
cin >> grades [i][j];
}
}
for (int i = 0; i < numrow; i++)
{
cout << endl;
for (int j = 0; j < numcol; j++)
{
cout << setw(4) << grades[i][j];
}
}
cout << endl;
system("PAUSE");
return 0;
}