Your while loops repeat until the end of the file; you don't need them.
while (inFile >> seat)
Use instead (without while ):
for (int a = 0; a < FC_Row; a++) // Read this amount of rows. for (int b = 0; b < FC_Col; b++) // Read this amount of columns. inFile >> firstClass[a][b] ; // Reading the next seat here.
Apply the same for economic places.
You may also want to change arrays to vectors, since variable-sized arrays are hell.
vector<vector<int> > firstClass(FC_Row, vector<int>(FC_Col)) ; vector<vector<int> > economyClass(EconRow, vector<int>(EconCol)) ;
You need #include <vector> use vectors, their access is identical to arrays.
Tugrul ates
source share