Which access specifier makes a class member accessible only within the class and its friends?

Options

  • A. public
  • B. protected
  • C. private
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. private

Detailed Explanation

Correct Answer: Option C

Explanation:
A private member can be accessed by member functions and friends of that class. It cannot be accessed directly from ordinary outside code or directly by derived-class member functions.