Page 1 of 1

3. Word Counter Write a function that accepts a pointer to a C-string as an argument and returns the number of words con

Posted: Mon May 02, 2022 11:38 am
by answerhappygod
3 Word Counter Write A Function That Accepts A Pointer To A C String As An Argument And Returns The Number Of Words Con 1
3 Word Counter Write A Function That Accepts A Pointer To A C String As An Argument And Returns The Number Of Words Con 1 (21.09 KiB) Viewed 59 times
3. Word Counter Write a function that accepts a pointer to a C-string as an argument and returns the number of words contained in the string. For instance, if the string argument is "Four score and seven years ago" the function should return the number 6. Demonstrate the function in a program that asks the user to input a string then passes it to the func- tion. The number of words in the string should be displayed on the screen. Optional Exercise: Write an overloaded version of this function that accepts a string class object as its argument.