I'm trying to hide user input (from keyboard-->using it to password)in win32 console application. I failed to manipulate getchar() and putchar() for that.
Is there a way to do it in C (or C++)?
Yup, Visual C++ has a non-standard header <conio.h> which has function called getch() which gets a character (returned as an int) and doesn't echo it to the screen. The getche() function does the same thing, but does echo it to the screen.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.