List all the escape sequence characters in C Programming Language. In ASCII table total numbers of character are 256 which divided into total 3 parts, Printable, Non-printable, and Extended. If we talk about ASCII 7-bits there are a total of 128 characters, in which 95 are printable and 33 are not printable. So if Escape character is not a part of ASCII table then the question is what are Escape Sequence.
What is the Meaning of 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 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 of escape character and some other characters combination, we use to print some impossible characters. In c, all escape sequences consist of two or more characters it a combination of backslash and characters.
List all the Escape Sequence Characters in C
|\a||Alarm or Beep||A beep sound is generated|
|\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|