aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CST116F2021-Lab9/CST116F2021-Lab9.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/CST116F2021-Lab9/CST116F2021-Lab9.cpp b/CST116F2021-Lab9/CST116F2021-Lab9.cpp
index f0034dc..9548b42 100644
--- a/CST116F2021-Lab9/CST116F2021-Lab9.cpp
+++ b/CST116F2021-Lab9/CST116F2021-Lab9.cpp
@@ -30,6 +30,7 @@ int main()
getInput(file_name);
readFile(file_name, info, size);
+ sortData(info, size);
while (menu != 5)
{
@@ -283,13 +284,15 @@ void writeFile(string writeArray[][ARRAY_SIZE], int writeSize, char writeName[NA
while (j < ARRAY_SIZE)
{
if(j != 3)
- outFile << left << setw(sizeof(writeArray[i][j]) + 1) << writeArray[i][j] << ' ';
+ outFile << writeArray[i][j] << ' ';
else
- outFile << left << setw(sizeof(writeArray[i][j])+ 1) << writeArray[i][j] << endl;
+ outFile << writeArray[i][j] << endl;
+ j++;
}
+ j = 0;
+ i++;
}
}
-
outFile.close();
}