How to understand the concept of class and object easily in c++ | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

How to understand the concept of class and object easily in c++

I did not understand it very well

6th Apr 2019, 5:37 AM
Ayush Srivastava
Ayush Srivastava - avatar
2 Réponses
+ 8
Ayush Shrivastav The easiest and best way to learn objective programming in any programming language is just to connect to real world. For eg, you created an object 'dog' The properties in natural language are(just example): Dog is black. Dog has 2 puppies. The methods are what dog does. For example: Dog barks. Dog eats. In c++: Dog d = new Dog(); cout<<d.color; //Black cout<<d.puppies; //2 dog.bark(); //Dog is barking dog.eat(); //Dog is eating
6th Apr 2019, 6:04 AM
Sarthak Pokhrel
Sarthak Pokhrel - avatar
+ 6
Ayush Shrivastav finish your course you have started in c++ Sololearn has a good object-class chapter on c++ for beginners.You can search for them directly from LEARN section too like I did for you: What is an Object https://www.sololearn.com/learn/CPlusPlus/1709/?ref=app when you finish this class will follow if you have any trouble then take help from here: https://www.geeksforgeeks.org/c-classes-and-objects/ and from : https://www.programiz.com/cpp-programming/object-class
6th Apr 2019, 5:59 AM
Daljeet Singh
Daljeet Singh - avatar