It is not always necessary that the type of the actual parameter match exactly the type of the formal parameter. The compiler will cast the type, if possible. Implicit casting, including promotion, is automatic among int and float types. Among integer types - bool , char , short , int , long . Between integer and floating-point types.
Implicit casting is automatic whenever there is an unambiguous rule, based on constructors.
Explicit casting may be used to force a type change. There must be a conversion rule available, based on constructors. This may resolve ambiguous references to overloaded functions.