Need help about declaring names

Needs help about strings and if and else .

#include <iostream>
#include <string>
using namespace std;

int main ()
string mystr;
cout << "What's your name? ";
getline (cin, mystr);
cout<<"Hi bro";
cout << "Hello " << mystr << ".\n";
cout << "What is your favorite team? ";

return 0;

Was trying to make a program which should say "Hi bro" to john and hello to any else,but when i try this if thing,it gives an error saying that john was not declared.Please help.
Where have you defined your variable named john?

I think you meant

if ( mystr == "john" )
ty vlad,i forgot to use "" =P,tyvm
Topic archived. No new replies allowed.