I found this code . Can Anyone please explain .
string str (“There are two needles in this haystack.”);
string str2 (“needle”);
if (str.find(str2) != string::npos) {
//… found.
}
What is npos here ?
I found this code . Can Anyone please explain .
string str (“There are two needles in this haystack.”);
string str2 (“needle”);
if (str.find(str2) != string::npos) {
//… found.
}
What is npos here ?