Computer Science 1037A/B Lecture Notes - Lecture 17: Member Variable

10 views1 pages

Document Summary

Class: a programmer-defined data type used to define objects. It is a pattern for creating object string fname, lname creates two objects of the string class. Used to control access to members of the class. Each member is declared to be either: public: can be accessed by functions outside of the class private: can only be called by or accessed by functions that are members of the class. It is used for internal processing by the class, not for use outside of the class. Can be listed in any order in a class. An object is an instance of a class. It can access members using dot operator sq1. setside(5); cout << sq1. getside(); Acessor, get, getter function: uses but does not modify a member variable. Mutator, set, setter function: modifies a member variable getside setside.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions