Question 5
Back to Exercise
Which declaration is valid?
- A void f(int a = 1, int b);
- B void f(int a, int b = 2, int c);
- C void f(int a, int b = 2, int c = 3); Correct
- D void f(int a = 1, int b, int c = 3);
Correct Answer: Option C
Once a parameter has a default, all parameters to its right need defaults too, because arguments are matched from the left.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!