![]() |
||
|
Lesson 1
Inside a class in C++
|
||
|
This module explores some of the basic concepts of building classes in C++ and introduces you to the internal workings of the
class construct.
The following will be discussed in this module:
By default, all members of a class declared with the class keyword have private access for all its members.
Therefore, any member that is declared before one other class specifier automatically has private access. For example:
class CRectangle {
int x, y;
public:
void setValues (int,int);
int area (void);
} rect;
Declares a class called CRectangle and an object of this class called rect.
This class contains four members:
|
||
|
|
||
