how to get a character from stdin without waiting for user to put it? [duplicate]
问题 This question already has answers here : How to avoid pressing enter with getchar() (11 answers) Closed 3 years ago . I'm writing a C program that prints something on terminal using ncurses. It should stop printing when user press 's' and continue again when press 's'. How can I read a key from input without waiting user to press the key? I tried getch() and getchar() but they wait until a key is pressed... Edit This is my code: int main(void) { initscr(); /* Start curses mode */ refresh(); /