-
C (
http://www.daniweb.com/forums/forum118.html)
| harrypotter | Feb 17th, 2006 12:56 pm | |
| How to input password in C Please tell me how to input password by showing a * or other symbol on console instead of text in C. |
| Narue | Feb 17th, 2006 1:48 pm | |
| Re: How to input password in C You need some way of reading raw input with a non-standard solution such as getch. Then it's just a matter of handling backspaces cleanly as printing an asterisk for every printing character that you read is trivial. |
| harrypotter | Feb 21st, 2006 1:30 pm | |
| Re: How to input password in C please explain in a clear way |
| agiorgio | Feb 21st, 2006 1:46 pm | |
| Re: How to input password in C Quote: Originally Posted by harrypotter please explain in a clear way | That wasn't clear? What Naru is saying is that there is no way in standard ANSI C to do what you are asking. However, there are extensions to the standard that allow for exactly what you want.
For example, the getch() function (part of the POSIX standard) allows you to get a single byte character from the terminal. Of course, if you're going to use this, you'll need to make sure that you have a version of the curses library to link against. |
| All times are GMT -4. The time now is 5:05 pm. | |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC