Q&A
Ask and answer questions to make information more available to wider audiences.
Allred Emilio @allredemilio   07, Apr 2023 12:00 AM
desctructors
What are destructors in C++?
answers 1
 
Answer 1
Gunner Birdson @birdsongunner   08, Apr 2023 09:26 AM
Destructors are members of functions in a class that delete an object when an object of the class goes out of scope. Destructors have the same name as the class preceded by a tilde (~) sign. Also, destructors follow a down-to-top approach, unlike constructors which follow a top-to-down.
Syntax:
~constructor_name();
tilde sign signifies that it is a destructor