integer literal - cppreference.com
Da cppreference.com.
|
|
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
<metanoindex/>
Sintassi
| [0-9]+ type_suffix | (1) | ||||||||
| 0 [0-7]+ type_suffix | (2) | ||||||||
| 0 x [0-9a-b]+ type_suffix | (3) | ||||||||
Spiegazione
# Notazione decimale
Original:
# Decimal notation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
# Notazione ottale
Original:
# Octal notation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
# Notazione esadecimale
Original:
# Hexadecimal notation
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Tipi di suffisso
, (Nessun suffisso)
Original:
;(no suffix)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
int- u
unsigned int- l
long- ul
unsigned long- ll (dal C++11)
long long- ull (dal C++11)
unsigned long long
Note
Lettere in costanti intere sono maiuscole e minuscole.
Original:
Letters in integer constants are case-insensitive.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Esempio
std::cout << 123 << '\n' << 0123 << '\n' << 0x123 << '\n' << 12345678901234567890UL << '\n' << -1u << '\n' << -1ull << '\n';
Output:
123 83 291 12345678901234567890 4294967295 18446744073709551615
(Uscita da un processore x86_64)
Original:
(output from an x86_64 processor)
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.