Книга: Advanced PIC Microcontroller Projects in C
3.1.9 Escape Sequences
3.1.9 Escape Sequences
Escape sequences are used to represent nonprintable ASCII characters. Table 3.3 shows some commonly used escape sequences and their representation in C language. For example, the character combination “n” represents the newline character.
Table 3.3: Some commonly used escape sequences
Escape sequence | Hex value | Character |
---|---|---|
a | 0x07 | BEL (bell) |
b | 0x08 | BS (backspace) |
t | 0x09 | HT (horizontal tab) |
n | 0x0A | LF (linefeed) |
v | 0x0B | VT (vertical feed) |
f | 0x0C | FF (formfeed) |
r | 0x0D | CR (carriage return) |
xH | String of hex digits |
An ASCII character can also be represented by specifying its hexadecimal code after a backslash. For example, the newline character can also be represented as “x0A”.
Оглавление статьи/книги
- 3.1.1 Comments
- 3.1.2 Beginning and Ending of a Program
- 3.1.3 Terminating Program Statements
- 3.1.4 White Spaces
- 3.1.5 Case Sensitivity
- 3.1.6 Variable Names
- 3.1.7 Variable Types
- 3.1.8 Constants
- 3.1.9 Escape Sequences
- 3.1.10 Static Variables
- 3.1.11 External Variables
- 3.1.12 Volatile Variables
- 3.1.13 Enumerated Variables
- 3.1.14 Arrays
- 3.1.15 Pointers
- 3.1.16 Structures
- 3.1.17 Unions
- 3.1.18 Operators in C
- 3.1.19 Modifying the Flow of Control
- 3.1.20 Mixing mikroC with Assembly Language Statements