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:
- depth of binary search tree d=log2(n+1) - 1 if n = 1000000...
- Wht is the use of Inheritnce in OOP?
- Variable Access Speed in C++
- What are constant members functions in c++ 2011
- Q: What is the difference between function declaration and...
- why we don’t use semicolon at the end of a function in C++?
- overloading and polymorphism in c++
- How to write a summation in a sequence? C++ 2011-12
- Why we use iostream.h in our program?
- Picking an IDE in c++ 2011
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)