Node:Special characters, Next:Character conversion table, Previous:Precedence of operators, Up:Top
Control characters are invisible on the screen. They have special purposes usually to do with cursor movement and are written into an ordinary string or character by typing a backslash character \ followed by some other character. These characters are listed below.
A character can be any ASCII character, printable or not printable
from values -128 to 127. (But only 0 to 127 are used.) Control
characters i.e. non printable characters are put into programs by
using a backslash \
and a special character or number. The characters
and their meanings are:
\b
\f
\n
\r
\t
\v
\x
\"
\'
\\
\ddd
Here is a code example that prints special characters:
/***************************************************/ /* */ /* Special Characters */ /* */ /***************************************************/ #include <stdio.h> main () { printf ("Beep! \7 \n"); printf ("ch = \'a\' \n"); printf (" <- Start of this line!! \r"); }
The output of this program is:
Beep! (and the BELL sound) ch = 'a' <- Start of this line!!
and the text cursor is left where the arrow points.