Reading a text file into a 2d array

If I have a data file as follows,

2 3
-1.8 3.6 6.7
3.4 -9.3 2.6

where the 2 and 3 designate how many rows and columns are in the matrix, what do I need to change for this code to not give me an assertion error. I've checked the other parts of my code and everything's working (all variables are defined in the full code). I'm using Visual Studio.

vector<vector<double>> mA(numRows,numCols);
ifstream input;

input >> numRows >> numCols;

for(i=0;i<numRows;i++)
{
for(j=0;j<numCols;j++)
{
input >> mA[i][j];
}
}
Topic archived. No new replies allowed.