Click here to Skip to main content
15,915,172 members

Comments by C from Cape Town,SA (Top 1 by date)

C from Cape Town,SA 7-May-13 7:56am View    
does it have to be a sql database?

could i do something like this, as I said i havent done Sql as yet
string username;
string password;
do {
std::cout << "username: ";
getline(std::cin, username);
if (username == "Raymond") {
std::cout << "password: ";
getline(std::cin, password);
if (password != "1234") {
std::cout << "invalid password. try again." << std::endl;
}
} else {
std::cout << "invalid username. try again." << std::endl;
}
} while (password != "1234");

i know it wont store anything