Object Oriented Programming (OOP)
OOP is the most important feature of c++ programming language.
Object-oriented programming is about objects that store data and the actions they can do.
Divide the whole program into objects.
oop language easy, flexible, reused designing approach.
Classes
Defining a class.
class Class_name{
Body of the class
};
A class is a group of data members and member functions .
Classes are defined to create user-defined data types.
The definition of a data type, like 'int', doesn't reserve memory space until a variable of that type is declared. if write int inside compiler, it can't reserve space.
When a variable of that data type is declared, a memory space is reserved for that variable.
int a;
Similarly classes.
It's common to start class names with a capital letter, but not necessary.
Post a Comment