One
Default parameters
#include <iostream>using namespace std;void fun (int i = +, int j = +, int k = ten); int main () {fun (); Fun (10 0, (+), (+); return 0;} void Fun (int i, int j, int k) {cout<<i<< "," <<j<< "," <<K<<ENDL;}
Two
Overload
#include <iostream>using namespace std;void fun (int i = +, int j = +, int k = ten); void fun (Double I, double j); int Main () {Fun (1.1, 1.2); Fun (1, 2); return 0;} void Fun (int i, int j, int k) {cout<<i<< "," <<j<< "," <<K<<ENDL;} void Fun (Double I, Double j) {cout<<i<< "," <<J<<ENDL;}
Results:
Inline functions:
#include <iostream>using namespace std;void fun (int i = +, int j = +, int k = ten), and inline void fun (double I, double j); int main () {Fun (1.1, 1.2); Fun (1, 2); return 0;} void Fun (int i, int j, int k) {cout<<i<< "," <<j<< "," <<K<<ENDL;} void Fun (Double I, Double j) {cout<<i<< "," <<J<<ENDL;}
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
---parameter characteristics of C + + learning notes