Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Encapsulation

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0

Please explain the difference betweein Private,Public and Protected
data members and functions.
 
Public functions and variables are available to any calling function. Constructors are usually public(but not always)
Variables can be modified by calling functions

Private functions and variables are only available to the class member functions and classes declared as friends

protected functions and variables are similar to private member functions but are also available to derived classes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top