Thursday, June 25, 2009

A function can have default parameters



NOTE : -
THIS CONTENT IS NOT ORIGINAL

12. A function can have default parameters

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:

3G S

JAIL BREAK

iPHONE

BILL GATES

StEvE JoBs

steve jobs

STEVE JOBS

Steve Jobs

Love Country

SD

Burroughs

Lift

Joseph Johnson

Apple Rainbow

Apple Blue

Apple Laser Printer