Character Sets
The basic source and execution character sets both contain the following types of characters:
The letters of the Latin alphabet
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
The decimal digits
0 1 2 3 4 5 6 7 8 9
The following 29 punctuation marks
! " # % & ' ( ) * + , - . / : ; < = > ? [ \ ] ^ _ { | } ~
The five whitespace characters
Space, horizontal tab, vertical tab, new line, and form feed
Each character in the basic character set must be representable in one byte.
The null character is a byte in which all bits are 0.
The value of each decimal digit after 0 is greater by one than that of the preceding digit.
Digraphs
C provides alternative representations for a number of punctuation marks that are not available on all keyboards .
Digraph | Equivalent |
---|---|
<: | [ |
:> | ] |
<% | { |
%> | } |
%: | # |
Trigraph | Equivalent |
---|---|
??( | [ |
??) | ] |
??< | { |
??> | } |
??= | # |
??/ | \ |
??! | | |
??' | ^ |
??- | ~ |
Escape sequence | Character value | Action on output device | |
---|---|---|---|
\' | A single quotation mark (') | Prints the character | |
\" | A double quotation mark (") |     | |
\? | A question mark (?) |     | |
\\ | A backslash character (\) |     | |
\a | Alert | Generates an audible or visible signal | |
\b | Backspace | Moves the active position back one character | |
\f | Form feed | Moves the active position to the beginning of the next page. | |
\n | Line feed | Moves the active position to the beginning of the next line. | |
\r | Carriage return | Moves the active position to the beginning of the current line | |
\t | Horizontal tab | Moves the active position to the next horizontal tab stop | |
\v | Vertical tab | Moves the active position to the next vertical tab stop | |
\o, \oo, or \ooo (where o is an octal digit) |
The character with the given octal code | Prints the character | |
\xh[h...] (where h is a hexadecimal digit) |
The character with the given hexadecimal code |     | |
\uhhhh \Uhhhhhhhh |
The character with the given universal character name |
    |
|