+ 3
Explain me clearly about class and objects in cpp.
I want to get a correct view.
5 Respuestas
+ 9
From what I understand:
Class is a container for methods, variables.
Objects are instance of classes.
+ 7
Class is a container which binds the data member and member function.it is user defined data type for defining or creating objects related to real life.
class is like structure...with a little modification. In class data member and member function are by default private however in structure these are public by default.
In case of creating a simple variable suppose of integer data type... int x;
now here..int is the data type and the variable is x. Similarly while declaring object..such as
student s;
student is the data type and s is the variable!!
+ 3
Class is an advanced struct where besides the data (variables) there can be also functions (methods). Classes and objects are core of object- oriented programming where any entity will present as class (scheme). You can think of the class as a custom type. If the class is a data type, (like int or float) than the object is a variable of this type.
+ 2
class is the entity of objects that means.. let's take an example mango, apple, grapes are the objects that belongs to class fruits....
+ 2
i want the fast way to calculate the reminder, please 😊