You are here:

C++/destructors

Advertisement


Question
hello sir,
         my ques is
can destructor  be invoked  explicitly?
1.  within a class?
2.   external to a class?  

Answer
Hi,

As far as I know it can be called explicitly in both cases.  Within a class it can be useful if the object maintains some kind of reference count and deletes itself when nobody is using  the object anymore (by calling "delete this").

Evgeny.

C++

All Answers


Answers by Expert:


Ask Experts

Volunteer


Evgeny Popovich

Expertise

I can answer C questions related to the language itself, OOP/OOD questions, C performance optimizations questions, 3D simulators questions, file-systems development questions.

Experience

I've got an experience of 4 years developing in C , from which 3 years developing real-time 3D simulations, and 1 years of system development. I've got extensive experience with OOP/OOD and a bit freak of clean code and good programming style and practices.

Organizations
Exanet, http://www.exanet.com

Publications
1. I/ITSEC 2005 Proceedings: Developing a Low Intensity Conflict Urban Simulation: Lessons Learned. 2. TESI 2005 Proceedings: Simulating an Infantry Platoon with Human-in-the-Loop.

Education/Credentials
I've got my B.Sc. in Software Engineering from the Technion - Israel Institute of Technology.

©2016 About.com. All rights reserved.