What is the default Function arguments?

Questions by surynisa   answers by surynisa

Showing Answers 1 - 4 of 4 Answers

samiksc

  • Feb 24th, 2006
 

Default function argument is a function argument with a default value. Callers of this function have a choice whether to pass a value for default argument or not. If a function call passes a value for default argument it is used as its value. If a function call does not pass a value the default value specified in the function definition is used.

A function may have any number of default arguments. However all these arguments must follow all mandatory arguments. That is first you have to specify all non-default or mandatory parameters and then all default parameters.

  Was this answer useful?  Yes

shudhanshu sharma

  • Feb 24th, 2006
 

Default Function arguments::

For eg: Suppose Function funcDefaultArg with two patameters of type int.

When declared like this :

int funcDefaultArg(int x=10,int y=27)

is said to be as default function arguments. 

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions