The character set is the fundamental raw material of any language and they are used to represent information. Like natural languages, computer language will also have a well-defined character set, which is useful to build the programs.
It denotes any alphabet, digit, or special symbol used to represent information.
The characters in C are grouped into the following categories:
- Alphabets
- Digits
- Special Characters
- White Space
ALPHABETS
- Uppercase letters A - Z
- Lowercase letters a - z
DIGITS
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
SPECIAL CHARACTERS
- +, - , /, @, #, $, %, & etc.....
WHITESPACE CHARACTERS
- \b - backspace
- \t - horizontal tab
- \v - vertical tab
- \\ - backslash
- \' - single quote
- \" - double quote
- \n - newline
- \0 - null
- \a - alarm(bell)
- \? - question mark
- \f - form feed
- \r - carriage return
Escape sequence characters
- Character combinations consisting of a backslash (\) followed by a letter or by a combination of digits are called "escape sequences."
- C uses some backslash characters in output functions for formatting the output. These characters are called Escape sequence characters. In these characters, it consists of two characters, But it is treated as a single character.
- Escape sequences are typically used to specify actions such as carriage returns and tab movements on terminals and printers. They are also used to provide literal representations of nonprinting characters and characters that usually have special meanings, such as the double quotation mark (").
- \n – newline
- \t – horizontal tab(default 8 spaces)
- \v – vertical tab(default 1 line)
- \b – back space
- \a – alert(beep sound)
- \r – Carriage return
- \f – form feed
- \0 – null
- \” – double quotes
- \’ – single quote
- \? – Question Mark
- \\- backslash
- \ooo - ASCII character in octal notation
- \xhh - ASCII character in hexadecimal notation
0 Comments