Is it possible to specify default arguments only for some middle arguments in a function, skipping the last ones?

  • Default arguments can only be specified for the first arguments.
  • Default arguments can only be specified for the last arguments.
  • No, default arguments must be specified for all or none of the function's arguments.
  • Yes, default arguments can be specified for middle arguments.
In C++, you can specify default arguments for some middle arguments while skipping the last ones. However, all arguments to the right of a default argument must also have default values.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *