Introduction to C Programming - Character Codes

Chapter chap1 section 9

Here is a list of ASCII character codes in octal and hexadecimal notation along with the equivalent C escape sequence where relevant. This table is not comprehensive.

Octal codeHexadecimal codeEscape SequenceControl SequenceStandard DesignationFunction
00000-Ctrl-@Nulldoes nothing
00101-Ctrl-ASOH-
00202-Ctrl-BSTX-
00303-Ctrl-CETXSometimes Break Program
00404-Ctrl-DEOTSometimes End of File
00505-Ctrl-EENQ-
00606-Ctrl-FACK-
00707\aCtrl-GBELAudible Signal
01008\bCtrl-HBSBackspace
01109\tCtrl-IHTTAB
0120a\nCtrl-JNLNewline or Linefeed
0130b\vCtrl-KVTVertical TAB
0140c\fCtrl-LFFNew Page or Clear Screen
0150d\rCtrl-MCRCarriage Return
0160e-Ctrl-NSO-
0170f-Ctrl-OSI-
02010-Ctrl-PDLE-
02111-Ctrl-QDC1Flow Control - On
02212-Ctrl-RDC2-
02313-Ctrl-SDC3Flow Control - Off
02414-Ctrl-TDC4-
02515-Ctrl-UNAKSometimes Line Delete
02616-Ctrl-VSYN-
02717-Ctrl-WETB-
03018-Ctrl-XCANSometimes Line Delete
03119-Ctrl-YEM-
0321a-Ctrl-ZSUBSometimes End of File
0331b-Ctrl-[ESCOften Escape for Screen Control
0341c-Ctrl-\FS-
0351d-Ctrl-]GS-
0361e-Ctrl-^RS-
0371f-Ctrl-_US-
04020--SPSpace - Hit the space bar

And the normal printing character codes with hexadecimal and octal equivalent values.

21 041 !  22 042 "  23 043 #  24 044 $  25 045 %  26 046 &  
27 047 '  28 050 (  29 051 )  2a 052 *  2b 053 +  2c 054 ,  
2d 055 -  2e 056 .  2f 057 /  30 060 0  31 061 1  32 062 2  
33 063 3  34 064 4  35 065 5  36 066 6  37 067 7  38 070 8  
39 071 9  3a 072 :  3b 073 ;  3c 074 <  3d 075 =  3e 076 >  
3f 077 ?  40 100 @  41 101 A  42 102 B  43 103 C  44 104 D  
45 105 E  46 106 F  47 107 G  48 110 H  49 111 I  4a 112 J  
4b 113 K  4c 114 L  4d 115 M  4e 116 N  4f 117 O  50 120 P  
51 121 Q  52 122 R  53 123 S  54 124 T  55 125 U  56 126 V  
57 127 W  58 130 X  59 131 Y  5a 132 Z  5b 133 [  5c 134 \  
5d 135 ]  5e 136 ^  5f 137 _  60 140 `  61 141 a  62 142 b  
63 143 c  64 144 d  65 145 e  66 146 f  67 147 g  68 150 h  
69 151 i  6a 152 j  6b 153 k  6c 154 l  6d 155 m  6e 156 n  
6f 157 o  70 160 p  71 161 q  72 162 r  73 163 s  74 164 t  
75 165 u  76 166 v  77 167 w  78 170 x  79 171 y  7a 172 z  
7b 173 {  7c 174 |  7d 175 }  7e 176 ~   


Exercises