Rules of function:
Class is a fresh concept introduced in C++. It is the core of objected oriented programming.
Class is advanced extension of structure in C language. The members in structure are array and primary data type. The members can be accessed globally or it can be said they are public members. Structure serve only limited. It is primarily used to group a collection of data and define it as a structure. Other than that there is special advantage of defining a structure. To overcome these boundaries C++ has introduced a new type of concept called Class.
A class is defined as structure with using key word class. A class can have primary data types and functions as its members. These members can be hidden by making as private members. When the members are not defined public as or private the members take default property as private members. To make the members public, the word public should be defined inside the class.