Namespace
Varianti

Escape sequences

Da cppreference.com.
< cpp‎ | language


 
 
Linguaggio C + +
Temi generali
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.
Tabella ASCII
Sequenze di escape
La storia del C + +
Controllo del flusso
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.
Dichiarazioni esecuzione condizionale
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.
Iterazione dichiarazioni
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.
Vai dichiarazioni
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.
Funzioni
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
dichiarazione di funzione
lambda funzione dichiarazione
funzione di modello
specificatore inline
eccezioni specifiche (deprecato)
noexcept specificatore (C++11)
Eccezioni
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Spazi dei nomi
Original:
Namespaces
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi
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)
Specifiers
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 specificatori
Durata di stoccaggio specificatori
constexpr specificatore (C++11)
specificatore auto (C++11)
alignas specificatore (C++11)
Inizializzazione
Original:
Initialization
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Letterali
Original:
Literals
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Espressioni
Original:
Expressions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rappresentazioni alternative
Utilities
Original:
Utilities
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi
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 alias dichiarazione (C++11)
attributi (C++11)
Lancia
Original:
Casts
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
conversioni implicite
const_cast conversion
static_cast conversion
dynamic_cast conversion
reinterpret_cast conversion
Fusione C-stile e funzionale
Occupazione della memoria
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.
Classi
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Specifiche per una classe di funzioni proprietà
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.
esplicito (C++11)
statico
Funzioni membro speciali
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.
Modelli
Original:
Templates
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
classe template
funzione di modello
modello di specializzazione
parametri confezioni (C++11)
Varie
Original:
Miscellaneous
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Montaggio in linea
 
Le sequenze di escape vengono utilizzati per definire alcuni caratteri speciali all'interno di stringhe letterali.
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.
Le sequenze di escape sono disponibili i seguenti:
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

[modifica] Note

La nuova linea \n carattere ha un significato speciale se usato in modalità testo di I / O, viene convertito il sistema operativo specifico byte nuova riga o una sequenza di 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.
Sequenze di escape ottali hanno un limite di tre cifre, ma terminare con il primo carattere che non è una cifra ottale valida se incontrate prima.
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.
Sequenze di escape esadecimali non hanno limite di lunghezza e termina con il primo carattere che non è una cifra esadecimale valida. Se il valore rappresentato da una singola sequenza di escape esadecimale non rientra l'intervallo di valori rappresentati dal tipo di carattere utilizzato in questa stringa letterale (char, char16_t, char32_t o wchar_t), il risultato non è specificato.
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.
Un nome di carattere universale in una stringa stretta letterale può associare a più di una causa di carattere multibyte di codifica.
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.
Il punto interrogativo \? sequenza di escape viene utilizzato per impedire trigrammi venga interpretato all'interno letterali stringa: una stringa come "??/" viene compilato come "\", ma se il marchio seconda domanda è scappato, come in "?\?/", diventa "??/"
Original:
The question mark escape sequence \? is used to prevent trigrammi 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.

[modifica] Esempio

#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?"

[modifica] Vedi anche