Escape Sequences
Character Set and Escape Sequences in C
📌 Character Set in C
In the C programming language, the character set consists of 256 characters.
It is broadly divided into:
1️⃣ ASCII character set
2️⃣ Extended ASCII character set
Apart from these, C also includes special characters called escape characters (escape sequences).
📌 Escape Characters (Escape Sequences)
Escape sequences are special character combinations beginning with a backslash \.
They are used to represent:
-
Non-printable characters
-
Formatting characters
-
Special symbols inside strings
📋 List of Escape Sequences in C
| Escape Sequence | Meaning |
|---|---|
\a | Alarm / Beep |
\b | Backspace |
\f | Form Feed |
\n | New Line |
\r | Carriage Return |
\t | Horizontal Tab |
\v | Vertical Tab |
\\ | Backslash |
\' | Single Quote |
\" | Double Quote |
\? | Question Mark |
\ooo | Character with octal value |
\xhh | Character with hexadecimal value |
\0 | Null character |
📌 Example Usage
Output
Comments
Post a Comment