How do I find the number of objects that are alive in C++?
<p>I want to find the objects of a class that are currently alive in C++.
Please tell me a solution for this.
Also, please correct if my logic is wrong!</p>

<ul>
<li>Declare a global variable.</li>
<li>Increment it during the constructor invocation.</li>
<li>Decrement during destructor invocation. </li>
</ul>

<p>Thanks in advance.</p>

<p>Sanjeev</p>
