so i have this set of strings which are stored in an array i want to search the array so when the string is found it should say found and when its not found it should say invalid
this is what i have so far
cout << "Enter a Name to Search" <<endl;
cin >>userInput;
for (int i=0; i<size; i++)
{
if (first_name[i]==userInput)
{
cout <<"Found"<<endl;
}else{
cout << "InValid"<<endl;
break;
}
}
so every time i run this i am always redirected to The else Statement is there anyway for me to fix this
userInputis the second entry in thefirst_namearray.sizeis declared?