// Trailing parameters can be given default values. // This also works for methods. // You can achieve the same effect through function overloading, // but this can be more convenient. #include using namespace std; // This functions accepts one or two arguments. void foo(int a, int b=4) { cout << "a=" << a << " b=" << b << '\n'; } int main() { foo(1,2); // Will print a=1 b=2 foo(3); // Will print a=3 b=4 return 0; }