Multiple choice

In C++, a function contained within a class is called ______.

  1. a member function

  2. a class

  3. an operator

  4. a data item

Reveal answer Fill a bubble to check yourself
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.