stdin.c
来自「C源码集」· C语言 代码 · 共 23 行
C
23 行
#include <stdio.h>int main (){ int ch; /* declared as int because EOF is -1 We don't know if char is defined as being signed or not in this compiler. If it is unsigned, will not pick up EOF */ while ((ch = getchar()) != EOF) printf("read %c \n", ch); /* getchar() reads from stdin, the keyboard. stdin is buffered so characters not processed until Enter is pressed. Then they, and Enter, are processed all together */ printf("EOF \n"); /* in DOS, ctrl-z is EOF. Can type this from the keyboard */ return 0;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?