You are on page 1of 3

CHARACTER SET

The character set is the fundamental raw material of any language and they are used to represent
information. Like natural languages, computer language also has well defined character set,
which is useful to build the programs. The Standard talks about two different character sets: the
one that programs are written in (Source character set) and the one that programs execute with
(Execution character set).

THE C ALPHABET
The Standard requires an alphabet of 96 symbols which is available for writing code in C, also
known as Source Character set. They are as follows:
a b c d e f g h I j k l m n o p q r s t u v w x y z
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
0 1 2 3 4 5 6 7 8 9
! # % & ( ) * + , - . /
: ; < = > ? [ \ ] ^ _ { | } ~

space, horizontal and vertical tab


form feed, newline

These symbols are combined together to represent different meaningful words, words are
combined together to represent meaningful statement, statements are combined together to
represent a meaningful task for the computer to perform.
ASCII CHARACTER SET
Now lets see the other form of alphabet which the program executes, also known as Execution Character
set. It is now well-known fact that computers can manage internally only 0s (zeros) and 1s (ones). And by
means of sequences of 0s and 1s the computer can express any numerical value as its binary translation.
Nevertheless, there is no such evident way to represent letters and other non-numeric characters with 0s
and 1s. Therefore, in order to do that, computers use ASCII tables, which are tables or lists that contain all
the letters in the Roman alphabet plus some additional characters. In these tables each character is always
represented by the same order number. For example, the ASCII code for the capital letter "A" is always
represented by the order number 65, which is easily representable using 0s and 1s in binary: 65 expressed
as a binary number is 1000001.

The standard ASCII table defines 128 character codes (from 0 to 127), of which, the first 32 are control
codes (non-printable), and the remaining 96 character codes are representable characters. The following
chart contains all 128 ASCII decimal (dec), octal (oct), hexadecimal (hex) and character (ch) codes.

ASCII CHART
dec oct hex ch

dec oct hex ch

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

0
1
2
3
4
5
6
7
10
11
12
13
14
15
16
17
20
21
22
23
24
25
26
27
30
31
32
33
34
35
36
37

00
01
02
03
04
05
06
07
08
09
0a
0b
0c
0d
0e
0f
10
11
12
13
14
15
16
17
18
19
1a
1b
1c
1d
1e
1f

NUL (null)
SOH (start of header)
STX (start of text)
ETX (end of text)
EOT (end of transmission)
ENQ (enquiry)
ACK (acknowledge)
BEL (bell)
BS (backspace)
HT (horizontal tab)
LF (line feed - new line)
VT (vertical tab)
FF (form feed - new page)
CR (carriage return)
SO (shift out)
SI (shift in)
DLE (data link escape)
DC1 (device control 1)
DC2 (device control 2)
DC3 (device control 3)
DC4 (device control 4)
NAK (negative
SYN (synchronous idle)
ETB (end of transmission
CAN (cancel)
EM (end of medium)
SUB (substitute)
ESC (escape)
FS (file separator)
GS (group separator)
RS (record separator)
US (unit separator)

40
41
42
43
44
45
46
47
50
51
52
53
54
55
56
57
60
61
62
63
64
65
66
67
70
71
72
73
74
75
76
77

20
21
22
23
24
25
26
27
28
29
2a
2b
2c
2d
2e
2f
30
31
32
33
34
35
36
37
38
39
3a
3b
3c
3d
3e
3f

(spac
e)

!
"
#
$
%
&
'
(
)
*
+
,
.
/
0
1
2
3
4
5
6
7
8
9
:
;
<
=
>
?

dec oct hex ch

dec oct hex ch

64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95

96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127

100
101
102
103
104
105
106
107
110
111
112
113
114
115
116
117
120
121
122
123
124
125
126
127
130
131
132
133
134
135
136
137

40
41
42
43
44
45
46
47
48
49
4a
4b
4c
4d
4e
4f
50
51
52
53
54
55
56
57
58
59
5a
5b
5c
5d
5e
5f

@
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
^
_

140
141
142
143
144
145
146
147
150
151
152
153
154
155
156
157
160
161
162
163
164
165
166
167
170
171
172
173
174
175
176
177

60
61
62
63
64
65
66
67
68
69
6a
6b
6c
6d
6e
6f
70
71
72
73
74
75
76
77
78
79
7a
7b
7c
7d
7e
7f

`
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
{
|
}
~
DEL (delete)

ESCAPE

SEQUENCES

Escape sequences are used to define certain special characters within string literals. These are special
characters that are difficult or impossible to express otherwise in the source code of a program, like
newline (\n) or tab (\t). All of them are preceded by a backslash (\). The following escape sequences are
available:

Escape

Description

sequence

\0
\a
\b
\t

ASCII
value

null

0
7
8
9

audible bell
backspace
horizontal

Escape
Description
sequence

\n
\v
\f
\r

line feed - new


vertical tab
form feed - new
carriage return

ASCII
value

10
11
12
13

Escape
ASCII
Description
sequence
value

\"
\'
\?
\\

double quote
single quote
question
backslash

22
27
63
92

RESERVED KEYWORDS
This is a list of some frequently used reserved keywords in C. Since they are used by the
language, these keywords are not available for re-definition.
auto
char
default
else

break
const
do
enum

case
continue
double
extern

float
if
register
signed

for
int
return
sizeof

goto
long
short
static

struct
typedef
unsigned
volatile

switch
union
void
while

You might also like