void myFunction(string country = "Norway") {
cout << country << "
";
}
int main() {
myFunction("Sweden");
myFunction("India");
myFunction();
myFunction("USA");
return 0;
}
// Sweden
// India
// Norway
// USA
void point(int x = 3, int y = 4);
point(1,2); // calls point(1,2)
point(1); // calls point(1,4)
point(); // calls point(3,4)
Rational CreateRational(int num, int denom=1) {
Rational result;
result.numerator=num;
result.denominator=denom;
return result;
}