What are Escape Sequences in C Programming?
Escape sequences are also known as Backslash Character Constants. In C, backslash ( \ ) is known as escape character because it causes an escape from the normal interpretation of string, so that the character is recognized as one having a special meaning.
A backslash ( \ ) followed by one or more special character is known as escape sequence. The escape sequence is used to express some action.
Escape Sequences in C Language
- \n : New Line
- \t : Horizontal Tab
- \r : Line Feed or Carriage Return (Takes the cursor to the beginning of line in which it is currently placed)
- \f : Form Feed
- \b : Move cursor one position the left of its current position
- \" : Double Quote
- \\ : Display Backslash
- \a : Alert (It alerts by sounding the speaker inside computer)
- \0 : It represents NULL character