password aplication console

4 replies [Last post]
klio
klio's picture
Offline
Neophyte
Joined: 2011/10/28

hi ive just made my password console application but i cant get it to work can someone help me this is the code
it is in c++
what should i do to change the password i mean that after i enter the new password ==> the password should change
,all i want is that the next time i open the applicatin it has the new password that i typed

#include <iostream>
#include <string>
using namespace std;

int main()
{

string a;
a= "word" ;// the password
string b;
cout<< "type your password";
cin>> b ;
if (a != b )
{
cout<<"wrong password"<<endl;
cout<<"change your password: yes/no"<<endl;
cin>>b;
if (b==="yes")
{
cout<<"type the new password"<<endl;
cin>> a;//the new password
}
else if(b=="no" )
return ;
}
else if( a == b)
{
cout<<"welcome";
}
return ;
}