objects and classes in C++
class :
in C++ class is a building block that leads to object oriented programming. it is a user defined data type , which holds it's own data members and member functions ,which can accessed and used by creating an instence of that class . A class is like a blue print for an object.
object :
An object is an instance of a class when a class is defined no memory is allocated but when A object of that class is initialized memory is allocated.
members in a class :
class has two type of members in C++
i) data members :-
variables declares in class. It can be privet, public and protected is called data members of a class.
* NOTE :- by default data members are privet in class *
ii) member functions :-
functions declaired in the class are called member function of a class.
defining a class in C++ :-
syntax :
class class_name
{
access_specifier :
data_members;
access_specifier:
member_functions()
{
member_function definition;
};
*NOTE :- a class should be end with a semi colon (;) sign *
