Whqtz the actual fact behind a constructor and destructor? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Whqtz the actual fact behind a constructor and destructor?

2nd Apr 2017, 9:09 AM
Kunal
Kunal - avatar
3 ответов
0
A constructor is a special member function which is used to initialize the objects that are created. Whereas a destructor is used to destroy the object which has been created or to free the memory acquired by the object. Even if we don't use constructor in our programme a default constructor is called by complier to initialize the data part of the object.
2nd Apr 2017, 9:47 AM
Mihir Patel
0
thanks
2nd Apr 2017, 9:48 AM
Kunal
Kunal - avatar