constint NUM_OF_ACCOUNTS = 1;
Account *account = new Account[NUM_OF_ACCOUNTS];
int AccountSearch(int number, string password);
foundAccount = AccountSearch(aNumSearch, passSearch);
int AccountSearch(int n, string p);
{
int x = 0;
for(; x < NUM_OF_ACCOUNTS; x++)
{
if(account[x].getAccNum() == number &&
account[x].getPassword() == password)
return x;
}
return x;
}
if (foundAccount == 0)
{
cout << "Your account was not found or you entered""a invalid account number and/or passoword." << endl;
}
else
{
cout << "You are now logged into your account..." << endl;
cout << "-------------------------------------" << endl;
}
Give the full error message, it tells you which symbol is unresolved. It is not related to a specific line of code - rather, it (usually) means that some function hasn't been defined.
int AccountSearch(int n, string p);
{
int x = 0;
for(; x < NUM_OF_ACCOUNTS; x++)
{
if(account[x].getAccNum() == number &&
account[x].getPassword() == password)
return x;
}
return x;
}
I also think I should note this is being used in a case switch
1. You can't define a function inside another function
2. That semicolon at the end of the line makes it a declaration, and so the braces with code in them are just more code to execute. Did you not notice that you couldn't use n and p?