NOTE : -
THIS CONTENT IS NOT ORIGINAL
12. A function can have default parameters
It is possible to define default parameters for functions:
It is possible to define default parameters for functions:
using namespace std;
#include
double test (double a, double b = 7)
{
return a - b;
}
int main ()
{
cout << test (14, 5) << endl; // Displays 14 - 5
cout << test (14) << endl; // Displays 14 - 7
return 0;
}
| Output |
| 9 7 |
BIBILOGRAPHY / REFERENCE : - http://www.4p8.com/eric.brasseur/cppcen.html

No comments:
Post a Comment