Skip to content

There are no short integer literals #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cpp/numeric-boolean-and-pointer-literals-cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Sometimes it's important to tell the compiler how to interpret a literal, or wha

## Integer literals

Integer literals begin with a digit and have no fractional parts or exponents. You can specify integer literals in decimal, octal, or hexadecimal form. You can specify signed or unsigned types, and long or short types.
Integer literals begin with a digit and have no fractional parts or exponents. You can specify integer literals in decimal, binary, octal, or hexadecimal form. You can optionally specify an integer literal as unsigned, and as a long or long long type, by using a suffix.

When no prefix or suffix is present, the compiler will give an integral literal value type **`int`** (32 bits), if the value will fit, otherwise it will give it type **`long long`** (64 bits).

Expand Down