When you cannot type characters into your string, use the escape sequences to insert nonprintable characters into text strings, char variables, and arrays. Here are common C escape sequences:

Characters What It Represents or Displays
\a Bell ("beep!")
\b Backspace, non-erasing
\f Form feed or clear the screen
\n Newline
\r Carriage return
\t Tab
\v Vertical tab
\\ Backslash character
\? Question mark
\' Single quote
\" Double quote
\xnn Hexadecimal character code nn
\onn Octal character code nn
\nn Octal character code nn

Using escape sequences is the secret way to embed characters you cannot type into a string, or to test for those characters in a conditional statement or for regular input. Even printable characters can be coded by using an escape sequence. The \x hexadecimal and \nn sequences can represent any ASCII character.