How do i make the output appear like this "*******" when someones entering a string?
Printable View
How do i make the output appear like this "*******" when someones entering a string?
No one has any ideas?
If this is for a Windows console app you can use _getch to get a character at a time with no echo to the screen. You can then output a * for each character read until enter is pressed.
NOTE: this code is off the top of my head and has not been tested at all! I don't know which library _getch is in. You will need to look it up.Code:char ch;
do{
ch = _getch();
cout << "*";
}
while(ch != 13);