data in class

Hello, can you help me explain this question? which different between protected, public, private, internal protected data in class?
hello mp121209,

private
Class members declared as private can be used only by member functions and friends (classes or functions) of the class.

protected
Class members declared as protected can be used by member functions and friends (classes or functions) of the class. Additionally, they can be used by classes derived from the class.

public
Class members declared as public can be used by any function.


Topic archived. No new replies allowed.