Question: Please help me with this C++ example. I will provide the given codes below the pictured instructions. thank you so much ------------------------------------------------------------------------------------------------------------------------- // word5.h #ifndef
Please help me with this C++ example. I will provide the given codes below the pictured instructions. thank you so much


-------------------------------------------------------------------------------------------------------------------------
// word5.h
#ifndef _WORD5_H #define _WORD5_H
class Word { private:
char *buf;
static int wordCount; public:
Word(char *s);
int getCount(); };
#endif
-------------------------------------------------------------------------------------------------------------------------
// word5.cpp
#include
int Word::wordCount = 0;
Word::Word(char *s) { buf = strdup(s);
wordCount++; }
int Word::getCount() {
return wordCount; }
& Static Homework 1. Add a destructor Create a destructor to the Word5 class below which decrements wordCount. a driver for your code and show that your destructor works. // word5.h tifndef WORDS H tdefine WORDS H class Word f private: char *but: static int wordCount: public: Word (char *s); int getCount ) tendif /1 words.opp include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
