İ writing password correctly but it s still says wrong

Hello everyone i need some help. There is a problem but i can not solve it
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  #include <iostream>

using namespace std;

int main ()
{
	char password;
	int currentlypw=4747;
	
	cout << "Write your password : ";
	cin >> password;
	if (password == currentlypw)
	{
		cout << "Succesfully.";
				
	}	
	
	else
	{
		cout << "password is wrong";		
	}	
	
}
Last edited on
is anyone of there to help me?
You're comparing an int to a char. A char is a single character.
Change char to int.
Last edited on
Thank you so much. thanks to you i solved it.
Last edited on
Topic archived. No new replies allowed.