// This is the phenomenon where a value is automatically converted to a different type in order to allow an operation to continue. For example, if you try to add together a floating point double value and an integer int value, the int will be converted to double first, and then the result of the addition will have type double as well. But if you save a double value to an int variable, the floating point value will be truncated to an integer! For example:
#include int main() { int x = 2; double y = 3.5; std::cout << "This result will be a double with value 5.5: " << (x+y) << std::endl;
int z = x+y; // This expression is calculated as a double, but then it's cast back to int! std::cout << "This result will be an int with value 5: " << z << std::endl;