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:
- character variables and assignment contain characters...
- assalam o alaikum sir Is that neccessory to use a Function...
- Pointers are not accessible for static member funcion
- char s1[] = "example"; char s2[20] = "another example"...
- Problem with the complexity of the program 2011
- what is Recursive function in c++ June 2011
- What does it mean command line? in C++ 2012
- how can i mail you the snapshot of compiled files.in C++...
- array project code c++ 2011
- A partial specialization may inherit from an ordinary class
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)