i am trying to scirpt a loggin program for a project of mine i do not have that much programming experience and have only been using C++ for around 3 days, i think i have done ok to write this so far but you may not and this would really help me to know that what i have done is wrong,
here is what i have so far
ok i hope this is ok and all, BUT here is where i am stuck i do not want to have to store X amount of strings in this C++ document what i would like to be able to do is store them in a database and have say 200 logins and username and password pairs that can be accessed through the login program above, i do not know is his is even possible, the problem with me storing the passwords and usernames in this program is that they can get crossed egCode:// Login program #include <iostream> #include <string> using namespace std; int main() { string user; string username = "john"; string pass; string password = "hello"; cout << "\tWelcome to Login\n\n"; do { cout << "Enter your Username: "; cin >> user; // put Username into user cout << "Enter your Password: "; cin >> pass; // put passoword into pass if (user + pass == username + password) // If Username & Password are correct then will state cout << "Correct Username & Passowrd\n\n"; if (user + pass != username + password) // If Usename & Password are incorrect then will state cout << "Incorrect Username or Password\n\n"; } while (user + pass != username + password); // While User & Pass is not equal to the Username + Password cout << "\nConnecting to Login server.\n\n"; return 0; }
User1 can use User2's password and this makes it unsecure and means that there is a higher chance that anyone can get in by just random guessing, also on most password/login programs the password dose not apper as letters but as * could anyone give me advice or show me to a link that will explain it all to me.
Best wishes
Oscardin