Default function argument means to fix the value of one or more than one function parameters which you expect, will remain same in the entire or most of the program. For example you have a function named table() which takes two parameters number and upperlimit. Number is the value you want to print table of, and upperlimit contains the value upto which you want the table to be. In this case you will know that most of the time the value of upperlimit will be same i.e. 10, so you can fix this value.View more random threads:
- Define Call by reference in c++ 2011
- HUFFMAN ENCODING in C++ 2012
- Regarding variable declaration, i know about interger types
- what is difference between Data Members and Members...
- In file included from...
- how does cin actually work in 2011
- this pointer in c++
- excuteing the progreme and how does can i best my programe...
- omain knowledge and domain experts in c++ 2011
- why we use pointers or reference except using real name of...
table(int number, int upperlimit = 10);
Now whenever you call this function, the value of upperlimit will be 10 by default.
You can also call this function by only giving the parameter value for number variable only.
Sponsored Links
There are currently 1 users browsing this thread. (0 members and 1 guests)