having problem with using strings

hello everyone,
its been two days since i started c++ tutorials from this site and honestly its the best i've found so far.but theres a little problem.i wrote this simple program for login but cant make it work.i'm having problem with "string".

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <string>
using namespace std;

int main()

{
    string name;
    string password;
   password=xxyy;
  cout<<"enter your name = "<<endl;
  cin>>name;
  cout<<"enter your password = "<<endl;
  cin>>password;
  if (password==xxyy)
  {
  cout<<"Welcome"<<endl;
  }
  else
  cout<<"wrong password"<<endl;
  cout<<"goodbye"<<endl; 
return 0;
}
In line 14 use password=="xxyy"
thanks lendraDwi it worked!!
Last edited on
Topic archived. No new replies allowed.