ctlstr.c
来自「APUE(第二版)的随书源代码,与第一版的代码相比增加了一些章节的代码(详见第二」· C语言 代码 · 共 24 行
C
24 行
#include "calld.h"/* Make a printable string of the character "c", which may be a * control character. Works only with ASCII. */char *ctl_str(char c){ static char tempstr[6]; /* biggest is "\177" + null */ c &= 255; if (c == 0) return("\\0"); /* really shouldn't see a null */ else if (c < 040) sprintf(tempstr, "^%c", c + 'A' - 1); else if (c == 0177) return("DEL"); else if (c > 0177) sprintf(tempstr, "\\%03o", c); else sprintf(tempstr, "%c", c); return(tempstr);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?