Multiple choice technology programming languages

A __________function is used for accessing the non-public members of a class.

  1. Static

  2. Virtual

  3. Void

  4. Friend

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Friend functions are granted special access to private and protected members of a class. They're not member functions themselves but can access non-public data. This provides controlled way to expose private data to specific external functions without making it public.