C++ Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 9)
9.
Which of the following function declaration is/are incorrect?
int Sum(int a, int b = 2, int c = 3);
int Sum(int a = 5, int b);
int Sum(int a = 0, int b, int c = 3);
Both B and C are incorrect.
All are correct.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
15 comments Page 2 of 2.

Satyanarayana said:   1 decade ago
Default arguments must be at trailing side only or all arguments must be default arguments.

Abreham said:   10 years ago
What is the difference between function definition & function declaration?

Raksha G said:   9 years ago
Correct answer is A because default arguments should start from right.
(2)

Santosh kumar yadav said:   11 months ago
I think inc sum(int a = 0 ,int b int c =3) is the correct answer.

Dharmi said:   5 years ago
Why option B is incorrect?


Post your comments here:

Your comments will be displayed after verification.