2 // ** nonprtsh.c ** Program to show certain non print characters
3 // Based on algorithm by Dr P.J.Plauger CUJ oct 1990 p130
5 #include <stdio.h>
6 #include <conio.h>
7 #include <string.h>
9 void printxxx(int c);
10
11 void main(void)
12 {
13 int a=0x0;
14
15 while(a!=0x2a) // end program if * entered
16 {
17 printf("\nEnter character:");
18 a=getch();
19 printxxx(a);
20 }
21 }
2Z
23 void printxxx(int c!)
24 {
25 static char esc[]="\a\b\t\n\r\x1a\x1b";
26 static char prt[]="BEL\OBS \OHT \OLF \OCR \OSUB\OESC";
27 char *s=strchr(esc,c);
28 if(s)
Zf printf("[%s]",prt+4*(s-esc));
30 else
31 printf("%c",c);
32 }