Hello, I need help on writing a C++ program that allow the user to input two values: a username and a password. Below is what I have so far to test the password and it is not working.
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main ()
{
string username, password, login;
cout << "\n";
cout << " --------------- Username & Password ---------------\n";
cout << "\n";
vector <string> v;
cout << " Enter a Username (or 0 to stop).\n\n";
getline(cin, username);
while (username != "0")
{
password = "abc123";
login = username + password;
v.push_back(login);
getline(cin, username);
}
cout << "\n";
return 0;
}
I have the username working now I just need to get the password working. Any suggestions is greatly appreciated.