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

A Add a member varible that gets incremented in the default constructor and decremented in 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 connot be accoplished since the creation of objects is being done dynamically via"new." 

+ Answer
+ Report
Total Preview: 976

Copyright © 2024. Powered by Intellect Software Ltd