June 2025
Intermediate to advanced
1093 pages
33h 24m
English
When a function receives a parameter with a certain type, there are several possibilities for this parameter when it is called. Let's assume you have declared the func function as follows:
void func(double param);
Then the following can happen when you call it up:
func(5.3)—the type matches5.3 is a double literal and therefore exactly matches the parameter type double. The call works.
func("Text")—the type does not matchHere, the call is attempted with a const char[], which does not match double. This is an error that the compiler will inform you about.
func(7)—the type can be convertedAlthough 7 is an int, it can be converted into a double by the compiler. The call works, but the compiler first converts ...
Read now
Unlock full access