What is the basis concept behind class and object in cpp? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the basis concept behind class and object in cpp?

please answer it very basic conceptually so that i can easily understand.

10th Nov 2016, 1:15 AM
gobinda debnath
gobinda debnath - avatar
2 Answers
+ 5
class animal - object cat
12th Dec 2016, 11:12 AM
Klodian Lula
Klodian Lula - avatar
0
the concept of objects is to represent real life. If you need to have a contact application, without objects you must create several variables without any link between them. You can eventually use a structure. Classes are a bit like advanced structures. you create a class called person and then all variables related to thus will be included inside. like the name, the age, phone number.... Moreover with classes, you can create a class called employee for instance. And the employee inherite from person. So as in real life your employee is a person. So your employee will have a name, an age, phone numbers as a person. Then you can add a job variable in the class employee. you see ?
10th Nov 2016, 5:35 PM
Steve DICAY
Steve DICAY - avatar