Sequências de escape
Da cppreference.com
Sequências de escape são usadas para definir certos caracteres especiais dentro de strings literais.
As seguintes sequências de escape estão disponíveis:
| Sequência de escape |
Descrição |
|---|---|
| **\' ** | apóstrofe (byte 0x27) |
| **\" ** | aspas (byte 0x22) |
| ** ** |
backslash (byte 0x5c) |
| **\0** | caracter null (byte 0x00) |
| **\a** | campainha audível (byte 0x07) |
| **\b** | backspace (byte 0x08) |
| **\f** | form feed - new page (byte 0x0c) |
| **\n** | line feed - new line (byte 0x0a) |
| **\r** | carriage return - enter (byte 0x0d) |
| **\t** | tabulação horizontal (byte 0x09) |
| **\v** | tabulação vertical (byte 0x0b) |
| **\nnn** | byte octal (nnn) |
| **\xnn** | byte hexadecimal (byte 0xnn) |
[editar] Exemplo
printf( "This\nis\na\ntest\n\nShe said, \"How are you?\"\n" );
que iria mostrar
This is a test She said, "How are you?"