This is my line of code. In the "worldSeriesChampions.txt" the San Francisco Giants win twice I believe. When I run the program and enter the San Francisco Giants when prompted, the program doesn't seem to match the name from the while loop that I created. Can someone help me please? Thank you!
It's late so I might have missed something obvious, but no errors jump out at me. I'd start checking for typos or differences in the data between the two files: does one record have "San Francisco Giants" and the other "New York Giants" perhaps, or just "Giants"?
Also, have you checked to make sure your vector is being filled?
1 2
for(int i = 0; i < worldChamps.size(); i++)
std::cout << worldChamps[i] << std::endl;
If the vector isn't populated, you won't find a match.
Also, are you only having trouble with the Giants or is it all teams?
Let us know what you find out. If it still isn't working I'll look again.