So the program reads contents from a text file into a vector and then the user enters in a string that they want to search for. The program iterates through the vector to find the string and then saves that line to another vector to display later(incase there is more then 1 instance of the string found). Here is what I have atm:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
void doSearch(vector<string> &phonelist, string searcher, vector<string> &holdNumbers)
{
int i = 0;
string value;
for (i = 0; i < phonelist.size(); i++)
{
if (phonelist.at(i) == searcher)
{
value = phonelist.at(i);
holdNumbers.push_back(value);
}
}
cout << holdNumbers.at(0);
}
I just get an R6010 error -abort() has been called.