1

I'm currently making a program and there's a Login function which I want to create.

It will just take the username and password details from the user and if it matches the data then it'll proceed forward.

But in place of password I want to display * instead of the entered input to hide the password.

The basic code is this

std::string username;
std::string password;

std::cout<<:"Please Enter your Username: ";
std::cin>>username;
std::cout<<"Please Enter your Password: ";
std::cin>>password;

So is there a way in which I can take input from the user but as he enters the input the program displays * instead of password preferably using c++11 or newer?

NoobLearner
  • 61
  • 1
  • 6

0 Answers0