Question:You need to keep track of how many objects of a given class exist WITHOUT introducing a non-class member vairable. Which one of the following will allow you to do this? 

A Add a member variable 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 cannot be accomplished since the creation of objects is being done dynamically vai "new." 

+ Answer
+ Report
Total Preview: 231

Copyright © 2024. Powered by Intellect Software Ltd