0

The effect of a default argument can be alternatively achieved by overloading. How?

Please explain it with an example.

1st Jun 2020, 4:01 PM
Prashant Pant
Prashant Pant - avatar
1 Antwort
+ 3
void f(int n, char c) { //whatever } void f(int n) { f(n, 'x'); // x being default }
1st Jun 2020, 4:12 PM
HonFu
HonFu - avatar