Question

In a language like C++, if a member variable is declared protected, it means:

A It can be accessed from anywhere in the program.
B It can only be accessed from within the class itself.
C It can be accessed from within the class and by derived classes.
D It can only be accessed by friend functions.
E It cannot be accessed at all.
Practice Next

Hey! Ask a query