CSC 2110 Study Guide - Midterm Guide: Class Variable, Reserved Word, In C

152 views10 pages

Document Summary

An object combines data and the operations on that data in a single un it. In c++, the mechanism that allows you to combine data and operations on that data in a single unit is called a class. A class is a collection of fixed number of components. The components of a class are called members. If a member of a class is a function, you typically use the function pro totype to declare that member. It can also access any member of the class. The members of the class are classified into three categories : You cannot access it directly outside the class. A class variable is called either a class object or class instance. A member function of a class that only access the values of the member vari able. Use const at the end of the heading of these functions. A member function of a class that modifies that values of the member variables.