
Overview of C++ 241
Keyword class
The class is a new keyword intr
oduced in C++. It is used in the same way as the struct keyword.
To declare a class, the following syntax is used:
Syntax:
<classkeyword> <class- name> [<:baseclasslist>]
{<member variable list>}
Class keyword: It is one of the keywords class, struct, or union.
Class-name: It can be any unique name inside its scope.
Baseclasslist: If the class is derived class, then it follows the list of the base class (es). It is optional.
Member variable list: Defines the data member variables and member functions.
Example:
class circle
{
int radius; // data member
int area (void); // member function ...