Friday, August 7, 2009

DEFAULT ARGUMENTS

C++ programming language has made if possible that functions can be called without specifying all its arguments.To archieve this goal a function call uses certain parameter or arguments called Actual Parameters and the called function holds perameters which are called as formal parameters.Sowhenever you ignore the actual argument the format parameter can intiaalized at the own value which is called as default argument value.And this value has to be intialized at the time of function prototype only and always the value should be initialized only from right to left.
Defaulth arguments are useful in situations where some arguments always the same value for instance bank intrest may remain the some for all customers for a particular period of deposit.It also provides a greater flexiblity to the programers.A function can be writhe with more parameters than are required for its most common application.Using default arguments a programmer can use only those arguments that are meaningfull to a particular situation.

No comments:

Post a Comment