First page Back Continue Last page Graphics
Default Arguments
A values that's used automatically if you omit the corresponding actual argument.
- int fun1 ( int ski = 1, int trail = 2, int tree = 3 );
Valid calls to fun1
- cout << fun1( ); // uses 1 for ski, 2 for tail, and 3 for tree.
- cout << fun1( -12 ); // uses -12 for ski, 2 for trail and 3 for tree.
- cout << fun1( 44, 18 ); // uses 44 for ski, 18 for trail and 3 for tree.
- cout << fun1( 8, 9, 10); // uses 8 for ski, 9 for trail, and 10 for tree.