responding in a sentence (cin?)

Suppose I wanted to answer a question like this in a sentence


cout<<" What did you do today? \n\n";


how would i do that? How could be able to input a sentence with spaces.
and then if my sentence includes the word "hockey" (or something), i'd ask it a different question.

Could you explain or just write a brief program showing this (that last one would be REALLY helpful)

Thanks
You can use getline and find functions
1
2
3
4
string answer;
getline( cin, answer );//Get full line
if ( answer.find("hello") )// Check if "hello" is in the answer
   cout << "Hello";

http://www.cplusplus.com/reference/string/getline.html
http://www.cplusplus.com/reference/string/string/find.html
Using cin to get user input:
http://www.cplusplus.com/forum/articles/6046/
Topic archived. No new replies allowed.