Literals and Type Conversion
Integer, Floating-Point, Character, and String Literals
Integer, floating point, character, and string literals are fixed values written directly in source code. They are not variables. They are the raw numbers, lett…
Binary, Octal, and Hexadecimal Literals
Binary, Octal, and Hexadecimal Literals in C++This lets you write integer literals in some other base than ten using binary, octal, or hexadecimal literals. The…
Implicit Type Conversion
Implicit type conversion, or "coercion," is the automatic translation performed by the compiler when a value of one type is used in a context where a different…
Narrowing Conversions
Narrowing conversions are implicit conversions that may result in losing information. The compiler will allow them automatically, but in many cases the new type…
Explicit Conversion with static_cast
Explicitly converting using static_cast means telling the compiler, in plain sight, that you have explicitly requested the conversion of a value to another type…
Numeric Overflow and Floating-Point Precision
Numeric Overflow and Floating Point Precision Limits in C++Numeric overflow and the limits of floating point precision are two ways that the finite nature of bu…