include int main(void) { printf("FormFeed\fAAABBB\n\n"); printf("CarrigeReturn\rAAABBB\n\n"); printf("Tab\tAAABBB\n\n"); printf("VTab\vAAABBB\n\n"); printf("CR+FF\r\fAAABBB\n\n"); printf("FF+CR\f\rAAABBB\n\n"); }
FormFeed
AAABBB
AAABBBeReturn
Tab AAABBB
VTab
AAABBB
CR+FF
AAABBB
FF+CR
AAABBB
Escape sequence | Hex value in ASCII | Character represented |
---|---|---|
\a | 07 | Alert (Beep, Bell) (added in C89)[1] |
\b | 08 | Backspace |
\f | 0C | Formfeed |
\n | 0A | Newline (Line Feed); see notes below |
\r | 0D | Carriage Return |
\t | 09 | Horizontal Tab |
\v | 0B | Vertical Tab |
\\ | 5C | Backslash |
\' | 27 | Single quotation mark |
\" | 22 | Double quotation mark |
\? | 3F | Question mark |
\nnnnote 1 | any | The byte whose numerical value is given by nnn interpreted as an octal number |
\xhh… | any | The byte whose numerical value is given by hh… interpreted as a hexadecimal number |