Which of the following is true about function overloading in C++?
- Functions must be in the same scope
- Return type can be used to differentiate overloaded functions
- Overloaded functions must have a different number of parameters
- Only member functions can be overloaded
Function overloading in C++ allows multiple functions with the same name but different parameters (types and/or number). They must be in the same scope. Return type alone cannot be used to distinguish overloaded functions, and both member and non-member functions can be overloaded.
Loading...
Related Quiz
- What is the role of the return statement in a lambda function?
- Declaring a function as a friend within a class _______ make that function a member of the class.
- How does friendship relation in C++ affect inheritance hierarchies, if at all?
- What is the basic idea behind recursion in programming?
- The ASCII value of 'A' in decimal is _______.