ifstream inputFile("input.txt");
vector<string> inputStr(5);
if (inputFile.is_open()){
for (int i = 0; i < 5; i++){
string line;
getline(inputFile, line);
inputStr[i] = strRead(line);
}
inputFile.close();
}
There are a few problems here that should be addressed.
[ ] The input file should be read from arguments, not hardwired as "input.txt."
[ ] The number of input arguments should not be limited to 5. All arguments in the file should be read and stored.
[ ] This method discards the argument names such that lines 34-38 must make assumptions about the order and content of the lines. Instead, use a map and catch the key and value for each key=value line in the input file.
Lines 22 through 32 are as follow:
There are a few problems here that should be addressed.