i have this
#include <iostream>
#include <string>
using namespace std;
int GetNumOfNonWSCharacters(string);
int FindText(string, string);
int ReplaceExclamation(string);
int ShortenSpace(string);
int GetNumOfWords(string);
switch (option) {
case GetNumOfNonWSCharacters:
int GetNumOfNonWSCharacters();
break;
case GetNumOfWords:
int GetNumOfWords();
break;
case FindText:
int FindText();
break;
case ReplaceExclamation:
int ReplaceExclamation();
break;
case ShortenSpace:
int ShortenSpace();
break;
case 'q':
break;
}
}while (option != 'q');
return 0;
}
/////////num of words///////////
int GetNumOfWords(char * numWords){
int i=0;
int words=0;
while(numWords[i] != '\0')
{
if(numWords[i] == '\t')
{
words++;
}
i++;
}
return words;
}
/////////////num of characters///////
int GetNumOfNonWSCharacters(string numWhite)
{
int count = 0;
for(unsigned int i = 0; i < numWhite.size(); ++i) {
if (!isspace(numWhite[i]))
++count;
}
cout << "Number of non-whitespace characters: " << count << endl;
return count;
}