Reference no: EM132211352
Write a program that reads n words and stores them in an array of pointers to characters (array of strings). Develop the following functions (assuming the max word length to be 30 characters long):
char** readWords(int wCount)
void printGerunds (char *words[], int wCount)
where, the readWords function should create an array of pointers to characters with wcount as its size, then read words from the user, stores these words in the table of strings and then returns a pointer to the created table.
On the other hand, the printGerunds function prints all the gerunds contained in the words array. In English, gerund is a noun derived from a verb by adding ing to it. For simplicity you should assume that any word ending with ing to be gerund. Test the functions by calling them from the main program. You must use cin and the extraction operator ( >> ) to read the words from the user.
Sample input/output:
How many words: 12
Enter 12 words:
I like my living room it is a quiet place for reading
Printing gerunds contained in the array:
living
reading