Escape characters are sequence of characters that are converted to some another character which are difficult or impossible to print directly. Characters such as new lines, you cannot print a new line directly in any programming language by hitting enter key. To print new line an special character is given \n which is later converted to new line by compiler. Likewise there are many escape sequence character used in programming languages.
An escape character begin with backward slash \ followed by escape character.
List of all escape sequence characters
Escape character | Description |
---|---|
\0 | NULL |
\a | Alert (Beep) |
\b | Backspace |
\e | Escape |
\f | Formfeed (Return) |
\n | New line |
\r | Carriage return |
\t | Horizontal Tab (Eight blank spaces) |
\v | Vertical Tab |
\\ | Backslash |
\’ | Single quotes |
\” | Double quotes |
\? | Question mark |