Can we use default arguments for both member methods of a class and standalone functions?

  • No, for neither
  • Yes, for both
  • Yes, for member methods only
  • Yes, for standalone functions only
Yes, for both. In C++, you can use default arguments for both member methods of a class and standalone (non-member) functions. Default arguments provide flexibility when calling functions or methods by allowing you to omit some arguments if they have defaults defined.
Add your answer
Loading...

Leave a comment

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