C++ Programming - Functions - Discussion

Discussion Forum : Functions - General Questions (Q.No. 5)
5.
Which of the following statement will be correct if the function has three arguments passed to it?
The trailing argument will be the default argument.
The first argument will be the default argument.
The middle argument will be the default argument.
All the argument will be the default argument.
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
30 comments Page 2 of 3.

Raji Saj said:   1 decade ago
@Anurag.

You can have more than one default arguments, all these should be at the end of the argument list.

Bhuvan said:   1 decade ago
@Priya & @Jayati Trailing argument means the last argument in the parameter list of function prototype.

Henry said:   2 years ago
Yes, it is confusing, but basically says the default argument can't be from right to left which is A.

ANKIT MISTRI said:   5 years ago
Default argument must be written in rightmost side of the argument list.

Why? Explain with reason.
(1)

Dipak ladani said:   1 decade ago
What is mean by trailing argument?

Answer: last argument of function is called trailing argument.
(1)

Riya Joshi said:   8 years ago
Why default argument must be written on the right most side of the argument list?

Please Explain.

Sana said:   1 decade ago
The default argument can be only given from right to the left in the given parameter list!

Srikanth said:   1 decade ago
I think the answer A is not correct.. because default arguments must start from left..

Suma sree said:   1 decade ago
What happend if all three arguments are default arguments. Give me reply please?

Suma sree said:   1 decade ago
All the arguments in function as default arguments it's not possible.


Post your comments here:

Your comments will be displayed after verification.