Hi, I have yet another question.
I'm gonna take one of my programmes which I wrote years ago. (Simply because of the simplicity of it.) It was a real basic "password" console app, which I now want to expand just for the heck of it. It was somethin' like this :
Then obviously, I would write the rest of the program. But I noticed that all the official "login programmes," always have a change password option, so I wanted one too. I have an idea about what I'm gonna do, but I'm not sure about how to do it.Code:#include <iostream> #include <string> using namespace std; int main() { std::string password; cout<<"Please enter a valid password:\n\n"; std::getline ( std::cin, password ); while ( password != "solaris" ) { cout<<"Invalid password.\nPlease try again:\n\n"; std::getline ( std::cin, password ); };
First, I'm gonna need somewhere to store the current password. Right ? I've also gotta make sure that every time the user "changes the password," it overwrites the current password, as oppose to creating a new one.
Any ideas ?
Thanks again.