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.
Loading...
Related Quiz
- What is a friend function in C++?
- Which type of function cannot be virtual in C++?
- How would you implement a loop that executes a specific number of times and uses an iterator?
- How does the conditional (ternary) operator ? : associate in terms of precedence?
- In C++, if a floating-point number is assigned to an integer type, the value will be ______.