INST 201 Lecture Notes - Lecture 8: Member Variable

61 views2 pages

Document Summary

Classes, fundamental elements of c++, are collections variables and functions operate on those variables. Together these variables and functions coherently describe the qualities of an object. The variables in a class definition are called data members, and a class"s functions are called member functions. A class"s variables and functions can have one of 3 basic accessibility types. Public members are visible directly through an object, whereas private members are completely hidden, only accessible within the class"s member functions. Protected members behave like private members, except that subclasses have direct access to them. One exception to member visibility is that of friend functions, which are allowed to operate on an object"s private data members even without belonging to the object"s class. Inheritance, the creation of subclasses from superclasses, is another key feature of. Subclasses inherit all the data members and member functions of their superclasses. In addition, they can have extra members to create a more specific kind of object.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents