1 Class Doubletrouble Contains Static Integer Member Called Howmuch Write Class Definition Q37094367

1) Class DoubleTrouble contains a static integer member calledhowMuch. Write the class definition and implementation code thatinitializes howMuch, increments howMuch each time an object of theDoubleTrouble type is constructed, and decrements howMuch each timean object of the DoubleTrouble type is destroyed.


Answer


//This is in C++class DoubleTrouble{ public: static int howMuch; DoubleTrouble(){ howMuch++; } ~DoubleTrouble(){ howMuch–; }

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.