Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

why destructors execute in reverse order in C++?

$
0
0
when we create an object of derived class.... first the base class constructor executes and then the derived class constructor executes........ but when an object of the derived class is destroyed the destructors execute in the reverse order.... what  i want to know is that why constructors execute base-to-derive and destructors execute derive-to-base???

farooq.hnf


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>