Question:You need to keep an eye on the existing number of objects of a given class without introducing a non-class variable. which of the following makes this happen? 

A Add a member variable that gets incremented in the default constructor and decremented the destructor. 

B Add a local variable that gets incremented in each constructor and decremented in the destructor 

C Add a static member variable that gets incremented in each constructor and decremented in the destructor 

D This cannot be accomplished since the creation of objects is being done dynamically via “new” 

+ Answer
+ Report
Total Preview: 839

Copyright © 2024. Powered by Intellect Software Ltd