I'm trying to compare a specific element of one vector, with that of another. I want to compare a user input to an input from a text file, so I have put both into separate vector<string> containers and want to see if element [i] of vector 1 is equal to element [i] of vector 2. My code looks something like that below
Did you include <string>? You haven't posted the complete error message. Make sure the error message shows the correct types (std::string).
If that doesn't help you can post a small example that when compiled gives the error message you got. That way it will be easy for us to spot the problem.
userAnswers is a std::vector<std::string> and Alist is a std::vector<Answer> so on line 92 you are trying to compare a std::string object to a Answer object.
If you want it to be possible to compare these two types in this order using operator== you will have to overload operator== to take a std::string as first argument and a Answer as second argument, otherwise you will have to find some other way to do the comparison.