Try creating a class:
Code:
class SentenceManip
{
public:
SentanceManip() { _vowels = 0; ... }
~SentanceManip() { }
void getSentence() { cin >> _phase; }
void wordCount();
void Display();
private:
string _phrase;
int _vowels;
int _consonants;
int _size;
};
inline void SentenceManip::wordCount ()
{
_size = _pharase.size();
...
}
-------------------------------------
int main()
{
SentenceManip obj;
cout << "Enter a phrase: ";
obj.getSentence();
obj.wordCount();
obj.Display();
return 0;
}
This is a general idea, but use a class concept to fit your own requirements.