I’ve been Googling around with no luck. I’m looking for a way to do getc() or gets() or whatever that does not echo to the terminal. I saw kbhit() but this doesn’t appear to be part of ANSI. Ideally, I’d like code that looks like
char s[100]; no_echo_gets(s); /* Won't echo to screen while being typed */ printf('%s\n', s);
Does anybody know a good ANSI compliant way to do this?
You can’t do it in a cross-platform manner using ANSI C. You’ll have to use some OS-specific code, or use a library such as ncurses.