Discussion :: Functions - General Questions (Q.No.5)
|Srikanth said: (May 23, 2012)|
|I think the answer A is not correct.. because default arguments must start from left..|
|Prabhakar said: (Aug 21, 2012)|
|Assignment of default values is always start from Right to left.|
|Sana said: (Sep 8, 2012)|
|The default argument can be only given from right to the left in the given parameter list!|
|Priya said: (Nov 20, 2012)|
|What are trailing arguments?|
|Jayati said: (Dec 22, 2012)|
|What is this trailing argument?|
|Naresh Punia said: (Jan 18, 2013)|
|If you have not defined default argument in function definition then there will be no default argument. By the way default argument always come in RHS of argument list.|
|Bhuvan said: (Jan 21, 2013)|
|@Priya & @Jayati Trailing argument means the last argument in the parameter list of function prototype.|
|Anurag Kumar said: (Feb 19, 2013)|
|If a function has three arguments then it is not necessary that the trailing argument will be default argument.|
|Rajisaj said: (Jun 7, 2013)|
|Only the argument at the end of the argument list can have default arguments.
Because if you insert the default arguments at the middle of the argument list, the compiler would lose track of what arguments went where.
void badfunc(int, int=2,int) // Wrong way...
void okfunc(int, int=2, int=5); // Correct.
|Raji Saj said: (Jun 7, 2013)|
You can have more than one default arguments, all these should be at the end of the argument list.
|Madhu said: (Aug 14, 2013)|
|What is mean by trailing argument?|
|Mayank Panchal said: (Aug 19, 2013)|
|When you go left to right the rightest part is called trail. Trailing arguments means you should keep default arguments in the rightest position.|
|Panjab Mane said: (Aug 24, 2013)|
|Trailing argument start from right to left.
@Priya & Jayati.
|Anuradha said: (Sep 17, 2013)|
|What are trailing argument?|
|Nitish said: (Feb 24, 2014)|
|Trailing argument means. In function right side argument is trailing argument.
e.g int fun (int, int, int a=4) ; int a=4 is trailing argument.
|Dipak Ladani said: (Mar 7, 2014)|
|What is mean by trailing argument?
Answer: last argument of function is called trailing argument.
|Suma Sree said: (May 12, 2014)|
|What happend if all three arguments are default arguments. Give me reply please?|
|Suma Sree said: (May 12, 2014)|
|All the arguments in function as default arguments it's not possible.|
|Trust said: (Oct 6, 2014)|
|Please help me with this question.
Write a program that declares 3 arrays of size 4 by 3 type integer your program should read the value of the two arrays, add the two array values and store the results in the third array declare another function to add two arrays and store the result in the third one.
|G Akhil said: (Oct 19, 2014)|
|One important point to note is that only the trailing arguments can have default value and therefore we must add defaults from right to left.|
|Sonu said: (Nov 1, 2014)|
|What is trailing argument with the help of example?|
|Mandy said: (Dec 24, 2015)|
|One more important point is that [D] will be also a correct answer because all arguments of a function will be default arguments.|
|Abbishek Rajh said: (Jan 4, 2016)|
|Is it so that all arguments to be a default?|
|Jhuma Biswas said: (Jun 2, 2016)|
|By seeing different arguments I become confused which one is right answer. I can't learn anything. It became too much confusing as well as I am losing the reliability.|
|Abhyuday said: (Sep 1, 2016)|
|In function we can make all arguments as default, what about that?|
|Priya said: (Sep 16, 2016)|
|Trailing argument means?|
|Riya Joshi said: (Aug 12, 2017)|
|Why default argument must be written on the right most side of the argument list?
|Sakshi said: (Aug 1, 2018)|
|Only the trailing arguments can have default values and therefore we must add default values form right-to-left.|
|Ankit Mistri said: (Oct 1, 2020)|
|Default argument must be written in rightmost side of the argument list.
Why? Explain with reason.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.