Node:Characters, Next:Assigning variables to one another, Previous:Allocating memory for strings, Up:Bits and pieces
Characters
In C, single characters are written enclosed by single quotes. This is
in contrast to strings of characters, which use double quotes
("..."
).
int ch; ch = 'a';
would give ch
the value of the character a
. The same effect can also
be achieved by writing:
char ch = 'a';
It is also possible to have the type:
unsigned char
This admits ASCII values from 0 to 255, rather than -128 to 127.