In C++, if you do not provide a return type for a function, it defaults to ______.

  • auto
  • int
  • nullptr_t
  • void
In C++, when a return type is not explicitly provided for a function, it defaults to 'void.' This means the function does not return a value. It's essential when you have functions that perform actions without returning a result, such as void functions for input/output or setting variables.
Add your answer
Loading...

Leave a comment

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