On MS-DOS (oldies), there was a function getch() usually in conio.h
that did this purpose.
Please reply at edouard...@hotmail.com
However, getc() does not allow the character at a time input the original
poster wanted; it does buffered I/O. I haven't thought too much about
this one, but I bet it would be ugly. I think the terminal would have to
be put into "raw" mode with a series of modifications via tcsetattr(),
and then you'd have to read() a single byte. It isn't as easy as the
getch() was, I'm afraid.
--
F. Michael Orr
Sr. Systems Engineer
Norfolk Public Schools, Norfolk, VA, USA
"Go Miami Dolphins!"
> Does anybody know how to get a single char from terminal without
> echo and before Newline char is entered?
>
> On MS-DOS (oldies), there was a function getch() usually in conio.h
> that did this purpose.
>
> Please reply at edouard...@hotmail.com
Use the "curses" library (man curses). Don't ask me how to use it,
I just know that that's what you use.
--
Enjoy,
-Ken Treimann
treimann at us dot ibm dot com