Which of the following is NOT true regarding function overloading in C++?

  • Overloaded functions may have different return types.
  • Overloaded functions must be in the same scope.
  • Overloaded functions must have different parameter types.
  • Overloaded functions must have the same name.
Regarding function overloading in C++, it is NOT true that overloaded functions must have the same name. Overloaded functions have the same name but different parameter lists. They may also have different return types, but the parameter list must differ either in the number of parameters or the type of parameters. Overloaded functions can be in the same scope or different scopes within the same program.
Add your answer
Loading...

Leave a comment

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