integer literal
Aus cppreference.com
<metanoindex/>
Syntax
Erklärung
# Dezimaldarstellung
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.
You can help to correct and verify the translation. Click here for instructions.
# Octal Notation
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.
You can help to correct and verify the translation. Click here for instructions.
# Hexadezimal
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.
You can help to correct and verify the translation. Click here for instructions.
Typen von Suffix
, (Kein Suffix)
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.
You can help to correct and verify the translation. Click here for instructions.
int- u
unsigned int- l
long- ul
unsigned long- ll (seit C++11)
long long- ull (seit C++11)
unsigned long long
Notes
- Letters in Integer-Konstanten sind Groß-und Kleinschreibung .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.
Beispiel
std::cout << 123 << '\n'
<< 0123 << '\n'
<< 0x123 << '\n'
<< 12345678901234567890UL << '\n'
<< -1u << '\n'
<< -1ull << '\n';
Output:
123
83
291
12345678901234567890
4294967295
18446744073709551615
(Ausgabe von einem x86_64 Prozessor)
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.
You can help to correct and verify the translation. Click here for instructions.
