+ 1
(C++ ) how to hide user input after execute
Any body help I want to hide my input in c++ For Example int number; cout<<"Enter the Number"; cin>>number; cout<<" Number is <<number; output : Enter number 23 Number is 23 In this code the User input also shown in program but I want when I press enter "Enter number 23" user input automatically removed just display "Number is 23". Anybody whose expert in c++
1 Odpowiedź
+ 3
Use '\b'. It erases one character, and the cursor moves back.
std::cout << "nawaz"; //screen shows : nawaz
std::cout << '\b'; //'z' is erased
But I haven't tested because computer isn't near.
https://www.google.com/search?q=C%2B%2B+delete+character+from+console