std::int64_t — exactly 64-bit signed integer type
std::int64_t from <cstdint> is an alias for a signed integer type with exactly 64 bits and no padding bits. Its availability is optional; do not assume that it always means long long.
CKTIS / Knowledge base
Programming syntax, operators and concepts. Find an explanation, explore an example and return to learning.
std::int64_t from <cstdint> is an alias for a signed integer type with exactly 64 bits and no padding bits. Its availability is optional; do not assume that it always means long long.
std::int8_t from <cstdint> is an optional alias for a signed integer type with exactly 8 bits and no padding bits. It stores values from -128 to 127. Calculations follow integral promotion rules, and explicitly converting to int is useful when printing its numeric value.
std::monostate is an empty type available through <variant>. It can represent an explicit state without data and, as the first std::variant alternative, enables default construction even when a later type has no default constructor.
std::nullptr_t is the distinct type of the nullptr literal, made available by <cstddef>. It is not a pointer type: its values can produce null pointers, while the type itself lets function overloads recognize nullptr.
std::ptrdiff_t is an implementation-defined signed integer type from <cstddef>. It is the result type of pointer subtraction, representing a distance in elements rather than bytes, and can hold negative values.
std::size_t is an implementation-defined unsigned integer type that can represent the size of any object in bytes. It is the result type of sizeof and is declared by <cstddef>. Do not assume a particular width or use it to represent negative values.
std::uint16_t from <cstdint> is an optional alias for an unsigned integer type with exactly 16 bits and a range of 0–65535. It is useful when an exact width is required, but it does not guarantee a two-byte size on every platform.
std::uint32_t from <cstdint> aliases an unsigned integer type with exactly 32 bits and no padding bits. It holds values from 0 through 4294967295. Whether the alias is available depends on the implementation.
std::uint64_t from <cstdint> is an optional alias for an unsigned integer type with exactly 64 bits and no padding bits. It stores values from 0 through 18446744073709551615.
std::uint8_t from <cstdint> is an optional alias for an unsigned integer type with exactly 8 bits and a range of 0–255. It undergoes integral promotions in calculations and may behave as a character when printed.
std::uintptr_t from <cstdint> is an unsigned integer type that supports converting a valid void* to an integer and back without losing the pointer value. It is optional in C++23 and specifies neither a fixed width nor a portable address format.
unsigned char is an unsigned integer type distinct from char and signed char. It occupies one C++ byte, not necessarily eight bits. It is useful for byte values, but undergoes integral promotions in expressions.
unsigned int stores nonnegative integers and is a distinct type from int. It has at least 16 value bits, and its arithmetic operates modulo 2^N. Learn the equivalent unsigned spelling and the pitfalls of conversions and comparisons involving signed integers.
unsigned long is a standard unsigned integer type with a width of at least 32 bits. It is the same type as unsigned long int. Its exact range depends on the implementation, and arithmetic performed in this type follows modular rules.
unsigned long long is a built-in unsigned integer type with at least 64 value bits. It stores nonnegative integers, and its arithmetic operates modulo 2^N. Its exact width depends on the implementation.
unsigned short is a built-in unsigned integer type, equivalent to unsigned short int. It supports at least the values from 0 through 65535, but need not be exactly 16 bits wide. In calculations, it is subject to integral promotions.
void is a fundamental type with no values, used primarily as the return type of a function that returns no value. Objects of type void cannot be created. The separate type void* can hold object pointers without retaining their pointed-to type information.
wchar_t is a distinct built-in integral type used for wide characters. The L prefix creates its corresponding literals. Size, signedness, and encoding depend on the implementation, so it is not a portable Unicode character type.
System.ArgumentOutOfRangeException signals that an argument value is outside the set accepted by a method. The exception can identify the parameter name and the rejected value.
Combine Array.Clone with Array.Sort to obtain a sorted array copy without changing the original element order. Learn how a shallow copy differs from sharing the same array.
Array.Empty<T>() returns a non-null array of type T[] with length zero. Use it to represent no elements without creating a new empty array on every call.
System.Array.IndexOf finds the first occurrence of a value in an array or a range and returns its index.
Array.Length returns an array's element count as int. For a multidimensional array it covers every dimension, and for an empty array it is 0.
AttributeUsageAttribute specifies where a custom attribute may be applied, whether it may be repeated, and whether it is inherited. AttributeTargets.Property restricts its use to properties.