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.
Loading...
Related Quiz
- In C++, when a parameter is passed by value, what exactly is being passed to the function?
- In C++, if a programmer forgets to deallocate memory using delete, it can result in a _______.
- The diamond problem occurs due to _______ and can be resolved using _______.
- Why is the use of the "using namespace std;" directive common in C++ programs?
- If no cases match in a switch statement and there's no default clause, then none of the switch blocks will execute.