![]() |
|
#1
|
||||
|
||||
redirect char input consoleI'am working with project that will be a console app.
Idont want to get in detail about my console app but what iam trying to do is to get a password string from the user in the same time i want to put that input char in the password string and output star kind of char in the output. like this... password:******* So guys is there a way to stop the output of char in same time access it from stdin file?? I hope someone understand my question |
|
#2
|
|||
|
|||
|
check this tutorial.
How to hide characters from being displayed on screen as they are keyed in? I used the linux_getch() function with little modification to print "*" when user is entering the password. CPP / C++ / C Code:
Also, check this other thread. Thanks, |
|
#3
|
||||
|
||||
|
thx for the replay....
I frogot to mention that iam on win(xp) os. <termios.h> is on linux os... so is't a way to make that hapen. Iam using visual 6 c++ and my project is win32 console application (my source is only in c). |
|
#4
|
|||
|
|||
|
Quote:
The thread in the link was a response to someone who had used getch() in Windows and wanted an equivalent for Linux. If you #include <conio.h>, you may be able to use getch(). (It is system-dependent. Older Microsoft compilers, including VC++ 6, have it; newer ones may not.) These are two system-dependent ways of using functions that are not part of the C standard, and, therefore, are not portable, but one or the other may be suitable for your purposes Regards, Dave |
|
#5
|
||||
|
||||
|
davekw7x thx very much m8 you saved me from killing my self
I got it fanily CPP / C++ / C Code:
|
|
#6
|
||||
|
||||
|
What if the user doesn't enter an alphanumeric? You should warn them:
CPP / C++ / C Code:
Also you need int main() and a return in your code. __________________
Age is unimportant -- except in cheese |
|
#7
|
|||
|
|||
|
Quote:
The Standard escape is '\a' (alarm). The effect of putchar('\a') is system-dependent, and may or may not cause a "beep". Regards, Dave |
|
#8
|
||||
|
||||
|
thx davekw7x...
the code i wrote was just ex so it wasn't the greates.. The code i will use in my project will handle if the user uses isspace(c). thx for help |
Recent GIDBlog
Developing GUIs with wxPython (Part 3) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [Tutorial] Pointers in C (Part I) | Stack Overflow | C Programming Language | 1 | 08-Apr-2005 18:35 |
| Compiling Errors | ToddSAFM | C++ Forum | 22 | 18-Dec-2004 11:42 |
| [C] Discarding input | Alhazred | C Programming Language | 8 | 04-Aug-2004 11:45 |
| (read/write file) newbie need help plz | momotx | C Programming Language | 6 | 28-Jan-2004 13:40 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The