Which among the following is a wrong call to the function void test(int x, int y=0, int z=0)?

Which among the following is a wrong call to the function void test(int x, int y=0, int z=0)?
A. test(5,6,7);
B. test(5);
C. test();
D. test(5,6);
 
Answer: c
Explanation: The function must be passed with at least one argument. There is two default arguments and one normal argument which must be passed with some value. Hence the third call to the function is wrong as it doesn’t pass even a single parameter to the function
 

Tìm kiếm

Back
Top