I'm trying to use the algorithm Search() with strings.
I get an error at the line where i marked.
Could somebody please give me a hint what am i doing wrong? Thanks in advance!
Code:
int main () {
vector<string> myvector ;
vector<int>::iterator it;
string str = "search";
string match = "ea";
myvector.push_back(str);
it = search (myvector.begin(), myvector.end(), match.begin(), match.end()); // error
if (it != myvector.end())
cout << "Match found at position: " << int(it - myvector.begin()) << endl;
else
cout << "Match not found." << endl;
system("pause");
return 0;
}
Sorry for the typo: algorithm.