Hey everyone, this is my first post in some time.. I need to create a simple C++ program that will count the number of words in an inputed sentence. I will admit that I am completely lost on how to do this..
I know posting questions to homework problems when looking for the exact answer or program as a reply is frowned upon, and please understand that is not what I am looking for. I simply wish for someone to point me in the right direction, or as to suggest what method, command, or function to use in my C++ program to count the number of words in an inputed string.
Thanks to all who who help! =)
Code:#include <iostream> #include <string.h> char sentence; int main() { std::cout << "Please enter a sentence and press Enter: "; std::cin >> sentence; return (0); }



LinkBack URL
About LinkBacks



