IF I have seven objects of playerType player, player1, player2, player3...etc and I want to search to see if there is a certain player in these objects, how would I do that. I know my code isnt complete and is quite off but if someone could take my blindfold off and point in the right direction, I would appreciate it.
bool playerType::searchPlayer(string searchFirst, string searchLast)
{
int i;
bool found = false;
for (i = 0; i < 6; i++)
if (name.getFirstName == searchFirst && name.getLastName == searchLast)
{
found = true;
break;
}
if (found)
cout << "Player is in database! ";
else
return false;
}