My question is once the user set up and account bye doing option 2 Then I want the user to have login so how do run programm so it then can retrieve information that user just used to register and the is able to login to my Game
std::string userName = getStringOfMinLength("Please enter a user ID", 6) ;
repeat2:
std::string password1 = getStringOfMinLength("Please enter a password", 7) ;
cout << "Please RENTER your password\n";
cin >> password2;
if (password1 != password2)
{
cout << "You have ReEnter your password incorrectly \n";
goto repeat2;
}
if (password1 == password2)
{
cout << "You Now registered with treasure Island\n";
cout << " User name: " << userName << " Password: " << password1 << '\n';
}
}
int Welcome()
{
cout << "Welcome to Adam's Quiz Game\n";
cout << "Login Enter 1 " "Create New Account Enter 2 \n" "Press 3 to Quit\n";
cin >> Login;
if (Login ==2)
{
UserSetup();
}
if (Login ==1)
{
string userName;
string password1;
cout << "Please enter use name\n";
cin >> userName;
cout << "Pleser enter password\n";
cin >> password1;
ifstream ifs("file path");
std::string str;
while(ifs.good())
{
getline(ifs, str);
//do whatever you want to with str;
cout << "You are now logded on to treasure Island\n"
}
}
}
My question is once the user set up and account bye doing option 2 Then I want the user to have login so how do run programm so it then can retrieve information that user just used to register and the is able to login to my Game
I think you would get help if it wasn't for how hard it is to read your code. You need to put it in code tags and make sure in each tag it's only code.