Program in c++ for object creation in class.
OBJECT:Objects are instances of class, which holds the data variables declared in class and the member functions work on these class objects.In other words a variable of type class is called object.In C++, when we declare a variable of type class, we call it instantiating(from instance) the class and variable itself is called an instance or object of that class.Object is of great importance in OOP,because, a class cannot be used without creating its object.The general syntax for creating an object of a class is given below.
Class_name Object_name;
For instance: CRectangle R1;// R1 is the object of the class CRectangle.
We can also create more than one object in a single statement like:
CRectangle R1,R2 ,R3;
Here, R1 ,R2, R3 are the objects of the same class CRectangle that share the same data member and member functions.
When an object is created then memory us set aside for all data members and member functions of that class.
Видео Program in c++ for object creation in class. канала Sehar Noreen
Class_name Object_name;
For instance: CRectangle R1;// R1 is the object of the class CRectangle.
We can also create more than one object in a single statement like:
CRectangle R1,R2 ,R3;
Here, R1 ,R2, R3 are the objects of the same class CRectangle that share the same data member and member functions.
When an object is created then memory us set aside for all data members and member functions of that class.
Видео Program in c++ for object creation in class. канала Sehar Noreen
Комментарии отсутствуют
Информация о видео
2 июня 2025 г. 0:00:31
00:09:51
Другие видео канала