Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int readFile(double values[][MAX_COLUMNS], int maxRows, string inputFileName){
- ifstream inFile;
- inFile.open(inputFileName);
- int rows;
- if (!inFile)
- return -1;
- else{
- for (rows = 0; rows < maxRows && !inFile.eof(); rows++){
- for (int cols = 0; cols < MAX_COLUMNS; cols++){
- inFile >> values[rows][cols];
- if (inFile.fail() && rows == 0)
- return 0;
- }
- }
- }
- inFile.close();
- return rows;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement