In this we discuss how to create classes in C++, accessing those classes using objects and access modifiers.
Summary:
Classes :
(Wikipedia's defination)
A class in C++ is a user defined type or data structure declared with keyword class that has data and functions (also called methods) as its members whose access is governed by the three access specifiers private, protected or public (by default access to members of a class is private).
The simple way to understand class is visualize is as a container that helps you organize your functions.
To access a class member you need to create its object. Object is a real life entity.
Access modifiers:
1) public: can be accessed by class members and outside the classes by creating objects of that class.
NOTE: Never make your variables public.
2) private: can be accessed by class members only.
3) protected: can be accessed by class members as well as derived classes.