What function will be called with the independent syntax “test(5,6,7);”?

Trang Mắm

New member
What function will be called with the independent syntax “test(5,6,7);”?
A. void test(int x, int y)
B. void test(int x=0, int y, int z)
C. int test(int x=0, y=0, z=0)
D. void test(int x, int y, int z=0)
 
Answer: d
Explanation: There are three arguments that are getting passed to the function test(). Only the last option have all the default argument at last in the argument list. And the total number of the arguments is three. The third option is wrong because the return type is int and the syntax given is independent which means it doesn’t return any value.
 

Tìm kiếm

Back
Top