Lisa is defining two functions with the same name and parameters but a different return type. She believes she is using function overloading. Is she correct?

  • No, she is not using function overloading.
  • She is defining a template function.
  • She is using function overriding.
  • Yes, she is using function overloading.
Lisa is not using function overloading. Function overloading is based on different parameter types or a different number of parameters. Having the same name and parameters with only different return types is not allowed in C++, as it would lead to ambiguity.
Add your answer
Loading...

Leave a comment

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