I just started messing around with making a password on a simple program. Can anyone here tell me how to, and explain, how to make asterisks appear when the user is enter the password? I searched a little but the few results i found, I didn't completely understand. Thanks
Code:#include <iostream> #include <string> using namespace std; int main() { string str1 = "suzuki"; string password ; do{ cout << "Enter Password\n"; getline(cin, password); if(password != str1) { cout << "Error, try again\n"; } } while(password != str1); int num1, num2; cout << "Enter a number to add\n"; cin >> num1; cout << "Enter a nother num\n"; cin >> num2; cout << " Total is " << num1 + num2 << endl; system("pause"); return 0; }