#include <iostream> using namespace std; void repchar(char='*', int=45); int main(){ repchar(); repchar('='); repchar('+', 30); return 0; } void repchar(char ch, int n) { for(int j=0; j<n; j++) cout << ch; }
7.6.default arguments | ||||
7.6.1. | Demonstrate default arguments | |||
7.6.2. | Function with two regular parameters and one parameter with default value | |||
7.6.3. | Use two default parameter values | |||
7.6.4. | Ambiguous function call with function with default parameter value | |||
7.6.5. | Using multiple default parameter values: defaults for reference parameters | |||
7.6.6. | demonstrates missing and default arguments |