listchars.c

来自「unix linux 编程实践源代码」· C语言 代码 · 共 17 行

C
17
字号
/*  listchars.c *      purpose: list individually all the chars seen on input *       output: char and ascii code, one pair per line *        input: stdin, until the letter Q *        notes: usesful to show that buffering/editing exists */#include        <stdio.h>main(){        int     c, n = 0;        while( ( c = getchar()) != 'Q' )                printf("char %3d is %c code %d\n", n++, c, c );}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?