The return statement can be omitted in a function with a return type other than void if _______. 

  • it's a template function 
  • it throws an exception 
  • it's a friend function 
  • it's an inline function
In C++, if a function with a return type other than void does not have a return statement, but throws an exception that exits the function, it's acceptable and will not result in a compilation error.
Add your answer
Loading...

Leave a comment

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