home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The C Users' Group Library 1994 August
/
wc-cdrom-cusersgrouplibrary-1994-08.iso
/
listings
/
v_09_04
/
9n04118a
< prev
next >
Wrap
Text File
|
1991-01-24
|
809b
|
33 lines
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=OxO;
I4
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 }