This may be some really stupid small problem, but I wrote a piece of code that would store passwords. It is really simply and not entirely done but I was wondering what the problem is with it. On running the code there is a space and then displays "Press ENTER to continue"
Then it quits. And here it is:
Also I was wondering how do you create memory for the program. Such as while in the program you could modify the passwords so that the passwords werent in the code exactly i think but they were in a file elsewhere which you could modify in the program through and option.Code:
#include <iostream>
using namespace std;
int main()
{
int password;
int input;
int second_number;
password = 908;
std::string email;
std::string steam;
std::string WoW;
std::string Mac;
email = "abcd1234";
steam = "abcd1234";
WoW = "abcd1234";
Mac = "abcd1234";
do {
cout<<"Please enter the password: ";
cin>> input;
cin.ignore();
switch ( input ) {
case 908:
cout<<"Acsses Granted.\n";
cout<<"\n";
cout<<"1.Email Password.\n";
cout<<"2.Steam Password.\n";
cout<<"3.WoW Password.\n";
cout<<"4.Mac Password.\n";
cout<<"Input the password you would desire: ";
cin>> second_number;
cin.ignore();
switch ( second_number ) {
case 1:
cout<<"\n";
cout<<"The Email Password is "<< email <<"\n";
break;
case 2:
cout<<"\n";
cout<<"The Steam Password is "<< steam <<"\n";
break;
case 3:
cout<<"\n";
cout<<"The WoW Password is "<< WoW <<"\n";
break;
case 4:
cout<<"\n";
cout<<"The Mac Password is "<< Mac <<"\n";
break;
case 23:
cout<<"\n";
cout<<"Password Managment acssesd.";
break;
default:
cout<<"Incorrect Selection";
break;
}
default:
cout<<"Acsses Denied.\n";
break;
}
} while ( input != 908 );
cin.get();
}
Thanks in advace.

