I'm working on an assignment for my computer science class. I was able to use an input file to store data into three separate arrays, and then I realized when I reread the assignment that I need to have the program ask the user what input file to use. I changed my code to reflect that and got this far and can not get past this error: line 23:
no matching function for call to `getline(char[51], std::string&)'
This syntax worked when I specified the input file as "inputFile.txt" but now that I have changed it to a variable, i get an error using this syntax. I'm a little lost and cant seem to find out how to do this in my book, or help on the error message online, so I'm posting here. Any ideas? Thanks!
You got these two mixed up. You probably meant to do this: getline(inFile, namesAR[indexCount]);
The lesson here is to make less confusing names. 'inputFile' doesn't represent a file, it reprents the name of a file, so a better name would be 'inFileName' or the like.
You might also run into confusion with other similar names, such as 'count' and 'indexCount'