Words

I know, i ask a lot of questions, but don't blame me, i am just beginner. I tried to find about it in the internet, but nothing. So, my question is :
I need, that if user enter a word (not 1 letter, as 'char') to variable , on example x, something is doing. On example through cin >> x;, user enter "Apple" , and through 'cout' showing a message. I know that i need to use 'if' for this, but what data type i need to use , and how ?
You need to use string. Example:
1
2
3
4
5
#include <string>
[...]
string word;
cin >> word;
if (word=="Apple")do_something();
Don't forget your "namespace std"!!!
Thanks, this part of code is very important for my programm. 2Computergeek01, yea, i won't forget.
Topic archived. No new replies allowed.