Consider a function declared with default arguments. If we provide a lesser number of arguments than expected when calling the function, how are the provided arguments matched?
- Arguments are matched based on data types.
- Arguments are matched from left to right.
- Arguments are matched from right to left.
- Compiler throws an error.
When calling a function with default arguments, the provided arguments are matched from left to right. If you provide fewer arguments, the remaining ones are matched with their corresponding default values, if any.
Loading...
Related Quiz
- In C++, a size of long double is at least _______ bytes.
- What is the default access specifier for a base class in C++?
- Sarah wants to create a menu-driven program where the menu is displayed repeatedly until the user selects the "Exit" option. What control structure can assist her in achieving this?
- For a loop to terminate, the loop condition should eventually evaluate to ______.
- The problem in which a derived class may inherit the same member more than once from a base class hierarchy is known as the _______ problem.