Tutorial by Examples

The standard doesn't specify if char should be signed or unsigned. Different compilers implement it differently, or might allow to change it using a command line switch.
The following types are defined as integral types: char Signed integer types Unsigned integer types char16_t and char32_t bool wchar_t With the exception of sizeof(char) / sizeof(signed char) / sizeof(unsigned char), which is split between § 3.9.1.1 [basic.fundamental/1] and § 5.3.3.1 [ex...
In C++, a byte is the space occupied by a char object. The number of bits in a byte is given by CHAR_BIT, which is defined in climits and required to be at least 8. While most modern systems have 8-bit bytes, and POSIX requires CHAR_BIT to be exactly 8, there are some systems where CHAR_BIT is great...
The result of casting a pointer to an integer using reinterpret_cast is implementation-defined, but "... is intended to be unsurprising to those who know the addressing structure of the underlying machine." int x = 42; int* p = &x; long addr = reinterpret_cast<long>(p); std::...
The ranges of the integer types are implementation-defined. The header <limits> provides the std::numeric_limits<T> template which provides the minimum and maximum values of all fundamental types. The values satisfy guarantees provided by the C standard through the <climits> and (&...
The standard requires that long double provides at least as much precision as double, which provides at least as much precision as float; and that a long double can represent any value that a double can represent, while a double can represent any value that a float can represent. The details of the ...
When either a signed or unsigned integer is converted to a signed integer type, and its value is not representable in the destination type, the value produced is implementation-defined. Example: // Suppose that on this implementation, the range of signed char is -128 to +127 and // the range of un...
If the underlying type is not explicitly specified for an unscoped enumeration type, it is determined in an implementation-defined manner. enum E { RED, GREEN, BLUE, }; using T = std::underlying_type<E>::type; // implementation-defined However, the standard does require th...

Page 1 of 1