Lec 5 : Introduction to Destructors in C++ | Types of Destructors | C++ Tutorials for Beginners
Vložit
- čas přidán 7. 06. 2024
- Lec 5 : Introduction to Destructors in C++ | Types of Destructors | C++ Tutorials for Beginners
#clanguage #cprogramming #programming
For Course detail contact with our Expert: +917630076300
Or visit : www.prideeducare.com
What is a destructor?
Destructor is an instance member function which is invoked automatically whenever an object is going to be destroyed. Meaning, a destructor is the last function that is going to be called before an object is destroyed.
Destructor is also a special member function like constructor. Destructor destroys the class objects created by constructor.
Destructor has the same name as their class name preceded by a tilde (~) symbol.
It is not possible to define more than one destructor.
The destructor is only one way to destroy the object create by constructor. Hence destructor can-not be overloaded.
Destructor neither requires any argument nor returns any value.
It is automatically called when object goes out of scope.
Destructor release memory space occupied by the objects created by constructor.
In destructor, objects are destroyed in the reverse of an object creation.
The thing is to be noted here, if the object is created by using new or the constructor uses new to allocate memory which resides in the heap memory or the free store, the destructor should use delete to free the memory.
Pride educare is India's Leading Edtech company based at Mumbai & Having 178 Training Centres Across India, Nepal & Bangladesh.
We specialise in Training & Development of Technical as well as Soft skills of the Candidates, We Make them Future Ready !!
6000+ Students are Taking Benefit of Online Live Interactive Lectures organised by our Expert Industry Experienced Team of Teachers.
Don't Just Waste your Lockdown days, Learn Courses & Be Future Ready !!
to join Any Courses Please Visit : app.prideeducare.com/
We Also Help Students to Start their Own business and Not just keep Searching for jobs.
To know more about our other Initiatives & Courses
Feel Free to Call : +917630076300
Or visit : www.prideeducare.com
Stay connected with us on your Favorite Social Media Platforms:
Facebook: / prideeducare
Instagram: / prideeducare
00:00 - Introduction
01:33 - Example Of Destructors
02:41 - Use Of Keywords
04:56 - How To Write Prototype Of Constructors
07:10 - Outro
#destructores
#cprogramming
#prideeducare
Thanks you ma m.
Mam please bsc c ka videos bna do pls🙏🙏
Ma bsc ka class babo do mam