Hi,
I have some questions about how to work with input from the keyboard. This code can read characters from the keyboard and print them:
However, how can I make so that the input isn't displayed to the screen and is also limited to one character each time (so that you don't have to press RETURN) ? Basically what I want is to make a switch statement based on a few characters read from the keyboard.Code:#include <stdio.h> main() { int c; c = getchar(); while(c != EOF) { putchar(c); c = getchar(); } return 0; }
Thanks in advance.



LinkBack URL
About LinkBacks


