Espaços nominais
Variantes
Acções

Escape sequences

Da cppreference.com
< cpp‎ | language


 
 
Linguagem C + +
Tópicos gerais
Original:
General topics
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tabela ASCII
Seqüências de escape
História do C + +
Controle de fluxo
Original:
Flow control
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Declarações execução condicional
Original:
Conditional execution statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Instruções de iteração
Original:
Iteration statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Ir declarações
Original:
Jump statements
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funções
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
declaração da função
lambda declaração da função
modelo de função
linha especificador
especificações de exceção (obsoleta)
noexcept especificador (C++11)
Exceções
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Namespaces
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
decltype specifier (C++11)
Especificadores
Original:
Specifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
cv especificadores
armazenamento duração especificadores
constexpr especificador (C++11)
auto especificador (C++11)
alignas especificador (C++11)
Inicialização
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Literais
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Expressões
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
representações alternativas
Utilitários
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipos
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
typedef declaration
tipo de alias declaração (C++11)
atributos (C++11)
Lança
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversões implícitas
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Elenco C-estilo e funcional
Alocação de memória
Original:
Memory allocation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Classe propriedades específicas de função
Original:
Class-specific function properties
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Funções membro especiais
Original:
Special member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modelos
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
modelo de classe
modelo de função
especialização de modelo
pacotes de parâmetros (C++11)
Diversos
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Assembly embutido
 
Seqüências de escape são usados ​​para definir certos caracteres especiais dentro de literais de cadeia.
Original:
Escape sequences are used to define certain special characters within string literals.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
As seqüências de escape estão disponíveis as seguintes:
Original:
The following escape sequences are available:
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Escape
sequence
Description Representation
\' single quote byte 0x27
\" double quote byte 0x22
\? question mark byte 0x3f
\\ backslash byte 0x5c
\0 null character byte 0x00
\a audible bell byte 0x07
\b backspace byte 0x08
\f form feed - new page byte 0x0c
\n line feed - new line byte 0x0a
\r carriage return byte 0x0d
\t horizontal tab byte 0x09
\v vertical tab byte 0x0b
\nnn arbitrary octal value byte nnn
\xnn arbitrary hexadecimal value byte nn
\u
nnnn
Original:
nnnn
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
arbitrary Unicode value.
May result in several characters.
code point U+nnnn
\U
nnnnnnnn
Original:
nnnnnnnn
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
arbitrary Unicode value.
May result in several characters.
code point U+nnnnnnnn

[editar] Notas

O \n caractere de nova linha tem um significado especial quando usado em modo texto de I / O, ele é convertido para o byte OS específico nova linha ou seqüência de byte.
Original:
The new-line character \n has special meaning when used in text mode I/O, it is converted to the OS-specific newline byte or byte sequence.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Seqüências de escape octais têm um limite de três dígitos octais, mas terminar no primeiro caractere que não é um dígito octal válido se encontrado mais cedo.
Original:
Octal escape sequences have a limit of three octal digits, but terminate at the first character that is not a valid octal digit if encountered sooner.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Seqüências de escape hexadecimais não têm limite de duração e terminar no primeiro caractere que não é um dígito hexadecimal válido. Se o valor representado por uma única seqüência hexadecimal fuga não se enquadra na gama de valores representados pelo tipo de caractere utilizado nesta seqüência literal (char, char16_t, char32_t, ou wchar_t), o resultado é indeterminado.
Original:
Hexadecimal escape sequences have no length limit and terminate at the first character that is not a valid hexadecimal digit. If the value represented by a single hexadecimal escape sequence does not fit the range of values represented by the character type used in this string literal (char, char16_t, char32_t, or wchar_t), the result is unspecified.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Um nome de caráter universal em uma corda estreita literal pode mapear a mais de uma por char para codificação multibyte.
Original:
A universal character name in a narrow string literal may map to more than one char due to multibyte encoding.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
O ponto de interrogação \? seqüência de escape é usado para prevenir trigraphs de ser interpretado dentro strings literais: uma string como "??/" é compilado como "\", mas se o ponto de interrogação segundo escapou, como em "?\?/", torna-se "??/"
Original:
The question mark escape sequence \? is used to prevent trigraphs from being interpreted inside string literals: a string such as "??/" is compiled as "\", but if the second question mark is escaped, as in "?\?/", it becomes "??/"
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[editar] Exemplo

#include <iostream>
 
int main()
{
    std::printf("This\nis\na\ntest\n\nShe said, \"How are you?\"\n");
}

Output:

This
is
a
test
 
She said, "How are you?"

[editar] Veja também