-5

I'm looking for a long time for a code that displays a different text depending on what you tipe. I didn't work at the app I wanted to make for a long time but I think this is what I tried (Remember I'm a begginer):

char text
cout << "Insert Text: " << text << endl;
if (text== "Stop")
{
 cout << "Ok. Bye!" << endl;
}
SoLux
  • 162
  • 1
  • 9
  • 7
    [I think you need to find yourself a good C++ book](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list) – NathanOliver Mar 08 '16 at 18:14

1 Answers1

0

you need to use cin to get something from the user. Also char means 'one single character'. Use strings instead

std::string text;
cout << "Insert Text: " << endl;
cin >> text;
if (text == "Stop")
{
    cout << "Ok. Bye!" << endl;
}
NathanOliver
  • 171,901
  • 28
  • 288
  • 402
pm100
  • 48,078
  • 23
  • 82
  • 145