How can I get a password that has been changed during the use of the program to be applied so that after the program is ended and started again, when it prompts for a password to start the program it wants the new password the user entered, not the original one? I know that sounds confusing but:
string o, password("oscar"), password2;
string password3, password4;
int main1()
{
cin >> o;
if(o == password)
{cout << endl;
main2();}
else
{cout << "\n\aIncorrect password.\n" << endl;
main();}
cin.clear();
cin.ignore(255, '\n');
cin.get();
return 0;
}
int pWord()
{
cout << "\nEnter current password: \n" << endl;
cin >> o;
if(o == password)
{
cout << "\nEnter new password:\n" << endl;
cin >> password2;
cout << "\nVerify new password:\n" << endl;
cin >> password3;
if(password2 == password3)
{
cout << "\nPassword change complete.\n" << endl;
main2(); }
else
{ cout << "\nPasswords do not match.\n" << endl;
pWord(); }
}
else
{
cout << "\nIncorrect password.\n" << endl;
pWord(); }
}
Those are the two main functions in my program that involve what I am talking about. The first is the function that prompts you for the password to begin the program, the second is a function within the program that allows you (or at least is supposed to allow you) to change the password that is requested in the first function. Any ideas how to make that happen?