Defining of Class in C++

Class in C++ is almost similar to structures. The only difference being that classes have functions too, as their members, apart from different types of variables. There is also one another difference between classes and structures. Such difference is that the members of a class are private. by default, while, the members of a structure are public, by default. The meanings of private members and public members will get clearer to you as move ahead with the tutorial. Defining or Declaration of Class: A class is a way to bind the data and its associated functions together. It allows the data (and functions) to be hidden, if necessary, from external use. While defining a class, we are creating a new abstract data type that can be treated like any other built-in data type. Generally, a class specification in C++ has two parts: Class declaration Class function definitions The class declaration...