+ 1
How to understand the concept of class and object easily in c++
I did not understand it very well
2 Antworten
+ 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
+ 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