Which is the correct condition for the default arguments?

Which is the correct condition for the default arguments?
A. Those must be declared as last arguments in argument list
B. Those must be declared first in the argument list
C. Those can be defined anywhere in the argument list
D. Those are declared inside the function definition
 
Answer: a
Explanation: The default arguments must be declared at last in the argument list. This is to ensure that the arguments doesn’t create ambiguity. The normal arguments should be passed first.
 

Tìm kiếm

Back
Top