Thanks for taking the time to read my post. I am writing a program where I read in data from a file into an array and a 2D array. However, when I cout that data to insure that it was all read in correctly, I get only the first full line of that input file(where there are actually 25 rows and 12 columns).
What am I doing wrong or should be doing differently? Thanks again.
for (int i = 0; i < NUM_STORES; i++){
fin >> storeID[i];
for(int j = 0; j < MONTHS; j++){
fin >> sales[i][j];
}
returntrue;
}
That returntrue; is part of the for loop you started on line 7. As such, that for loop will run only once. I am assuming that you misplaced the bracket on line 14 and that you wanted to have the loop run more than once.
I'm also assuming that lines 19 and below are part of another function because otherwise it makes no sense to have them since they never run.