August 2012
Intermediate to advanced
976 pages
30h 17m
English
In C++ some types are related to each other. When two types are related, we can use an object or value of one type where an operand of the related type is expected. Two types are related if there is a conversion between them.
As an example, consider the following expression, which initializes ival to 6:
int ival = 3.541 + 3; // the compiler might warn about loss of precision
The operands of the addition are values of two different types: 3.541 has type double, and 3 is an int. Rather than attempt to add values of the two different types, C++ defines a set of conversions to transform the operands to a common type. These ...
Read now
Unlock full access