Function Header?

How is a function header coded when the function call should allow a mix of default and required arguments?

Give an example of a calls using zero, one, and two default arguments, with one required argument; and the header of the function called.

Would this be okay?

int mul(int ra, int rb=3, int rc=4);
Give an example of a calls using zero, one, and two default arguments

Can you write the example, where mul is called with different number of arguments?
Didn't understand what you meant
Would this be okay?
 
int mul (int ra, int rb=3, int rc=4);


Yes, that is an acceptable function declaration for a function that takes 1 required argument and 2 optional arguments with default values. Required arguments must be specified before any default arguments.
Topic archived. No new replies allowed.