In C++, a function contained within a class is called ______.
-
a member function
-
a class
-
an operator
-
a data item
A
Correct answer
Explanation
A member function is a function that is defined within a class scope. These functions operate on objects of the class and can access private and protected members. Member functions define the behavior and operations that objects of the class can perform.