Wednesday, December 29, 2010

DIFFERENCE OF KEYWORD 'PUBLIC','PRIVATE','PROTECTED'

[1] OReilly - Practical C++ Programming.chm By Steve Oualline Publisher : O'Reilly
Pub Date : December 2002 ISBN : 0-596-00419-2 Pages : 574 21.1 Derived Classes

DIFFERENCE OF KEYWORD 'PUBLIC','PRIVATE','PROTECTED'
----------------------------------------------------
So the three protection keywords are:
private
Access is limited to the class only.
protected
The class and any derived class that use the class as a base class can access the member.
public
Anyone can access the member.

No comments: