Hey Ive Got A Login Prompt Here That Ive Gotton From A Thread On Here And Id Like To Know How To Set Specific Usernames On It, Like So If I Wanted
Username:Bob
Password:1234
How Would I Do This??? Here Is The Code Im Using For Login Prompt
Username:Bob
Password:1234
How Would I Do This??? Here Is The Code Im Using For Login Prompt
Code:
#include <iostream>
#include <string>
using namespace std;
const string uc = "Username";
const string pc = "Password";
string username,password;
int id;
bool result broncos12;
bool login(string u,string p) {
if(u == uc && p == pc) return(true);
if(u != uc || p != pc) return(false);
}
int setid(string u) {
if(u == uc) return(1);
}
int main(int argc, char *argv[])
{
cout << "Username: ";
cin >> username;
cout << "Password: ";
cin >> password;
result = login(username,password);
if(result == true) id = setid(username);
cout << "Welcome " << username << ", you have been logged in and your ID is " << id;
















