Quantcast
Channel: Comments on: 7.7 — Default parameters
Viewing all articles
Browse latest Browse all 48

By: simon1122

$
0
0

//Function
#include
using namespace std;

void printvalues(int nvalue1, int nvalue2=10 );

int main()
{

printvalues(1);
printvalues(1,3);

/*scaffolding code for testing purpose*/
cin.ignore(256, ‘\n’);
cout<< "press Enter to continue.." << endl;
cin.get();

return 0;
}

void printvalues(int nvalue1, int nvalue2 = 10 )
{

cout<<"1st : "<< nvalue1<< endl;
cout<<"2st : "<< nvalue2<< endl;

}


Viewing all articles
Browse latest Browse all 48

Trending Articles