List all the escape sequence characters in C or Escape Sequence in C Programming Language. In the ASCII table, the total numbers of character are 256 which is divided into total 3 parts, Printable, Non-printable, and Extended. If we talk about ASCII 7-bits there are a total of 128 characters, of which 95 are printable and 33 are not printable. So if the Escape character is not a part of the ASCII table then the question is what are Escape Sequences?
Table of Contents
What is the Meaning of the Escape Sequence in C?
An escape sequence is a sequence of characters that helps to convert some other characters(or escape sequence does not represent itself). for example, it’s impossible to print the newline so we use escape sequences to print the newline by using backslash “\” and character “n” together “\n“.
What is the Escape Character?
We cannot print a newline directly in any programming language(C, C++, Java, and C#) by just hitting the enter key. So here backslash is called “escape character“.
Use escape characters and some other characters combination, we use to print some impossible characters. In c, all escape sequences consist of two or more characters it is a combination of backslash and characters.
List all the Escape Sequence Characters in C
Escape Sequence | Meaning | Explanation |
\a | Alarm or Beep | A beep sound is generated |
\b | Backspace | Backspace |
\f | Form Feed | Form Feed page break(Return) |
\n | New Line | Shift the cursor control to the new line |
\r | Carriage Return | Shift the cursor to the beginning of the current line |
\t | Tab (Horizontal) | Shift the cursor to a couple of spaces(Eight blank spaces) to the right in the same line |
\v | Vertical Tab | Vertical Tab |
\\ | Backslash | Print the backslash character |
\’ | Single Quote | Display the single quotation mark. |
\” | Double Quote | Print the double-quotation mark |
\? | Question Mark | Display the question mark |
\nnn | octal number | Represent an octal number |
\xhh | hexadecimal number | Represent a hexadecimal number |
\0 | Null | Termination of the string |
Escape Sequence For Space in c
\b Escape Sequence For Space in c