Argument Promotions and Conversions
Since C++ is a strongly typed language, a C++ function call should use correct types and the number of actual arguments for each of the function formal parameters. Within the function body, the values of actual arguments are used as the values of corresponding formal parameters. If the number or the order of arguments does not match the number or order of formal parameters, it is a syntax error—no questions asked.
PutValues(25); // one argument is missing: error
If the number and the order of the arguments is correct, but the types are incompatible with corresponding parameter types, matching between arguments and parameters results in a syntax error. Types are called incompatible if a conversion between ...
Get Core C++ A Software Engineering Approach now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.