You don't seem to have the right perspective of C++ logic. In this case, try and convert all of the structures (for-loop, if-else statements, etc.) into English. If you can't, go and look it up or ask us and then proceed. This should help with your comprehension a tad bit.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
for(int i = 0; i < 20; i++)
{
if(account[i].firstName == lookFirst) //What are you comparing here? What is lookFirst equal too?
{
cout << "The name " << firstName << " was found: " << endl;
index = i;
i = 20; //Setting i to 20 will cause the for loop to break;
}
else
{
cout << "The name was not found: " << endl;
index = i; //Why are you setting index to i?
i = 20; //Same as above.
}
}