So I have this piece of code that has given me some headache. This is a function. names is an array that contains names. I ask user input to search and then I want to check if the name contains the string from search. I don't know what to do and didn't find anything that helped me (i'm probably just stupid).
bool contains(string*& names, string*& search){
for(unsigned int j = 0; j < names.length(); j++){
if(names[j].find(search) != string::npos){
return true;
}
}
return false;
}