I have homework due tomorrow and I have all my code written, but I have I function that I cannot seem to work. With the login class i am trying to call the username from within the customer class. The username is private. I just dont know exactly how to do it. I have literally spend about 5 hours on this same problem. I have referenced many websites with not success. Any help would be appreciated.
class userLogin
{
void userLogin_Verify()
{
string usernameLogin;
string passwordLogin;
customer::userName; //a nonstatic member referecnce must be relative to a specific object
int login();
cout << endl << "Username: ";
cin >> usernameLogin;
cout << endl << "Password: ";
cin >> passwordLogin;
while (usernameLogin != customer::userName)//a nonstatic member referecnce must be relative to a specific object
{
cout << endl << "The information you have entered is incorrect!" << endl;
cout << endl << "Username: ";
cin >> usernameLogin;
cout << endl << "Password: ";
cin >> passwordLogin;
}
}
};