4.12 — Introduction to type conversion and static_cast
Implicit type conversion Consider the following program: #include <iostream> void print(double x) // print takes a double parameter { std::cout << x << ‘\n’; } int main() { print(5); // what happens when we pass an int value? return 0; } In the above example, the print() function has a …