I am working on another thread, but I encountered a problem just testing importing into an array. I use this code and it just hangs. I am stuck, please help.
FYI, the scores.txt is in the same location as the source code.
#include <fstream>
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main ( )
{
const int ROWLIST=10;
const int COLLIST=10;
int inputARRAY[ROWLIST][COLLIST]={0};
ifstream infile;
infile.open("scores.txt");
int row=0;
int col=0;
while( !infile.eof() )
{
for ( row=0; row < ROWLIST; row++)
for ( col=0; col < COLLIST; col++)
inputARRAY[row][col];
}
for ( int r=0; r< ROWLIST; r++)
for ( int c=0;c<COLLIST;c++)
cout << inputARRAY[r][c] << endl;
infile.close();
return 0;
}