Checking cin against hardcoded cstring

How do I check a cstring gotten from cin>> against a hard-coded string? In other words, why doesn't pass() return 1?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include<iostream>
#include<cstdio>
#include<string>
bool pass(char[]);
using namespace std;
int main(){
char a[17];
while(pass(a) != 1){
cin>> a;
}
return 0;
}



bool pass(char store[17]){if(store == "CaKz2LfQgdivfoLp"){return 1;}return 0;}

//CaKz2LfQgdivfoLp 
The function returned zero... If they're both equal then why doesn't (store == "CaKz2LfQgdivfoLp") return 1?
store contains an address not a string.
Oh, right. Got it, thanks.
Topic archived. No new replies allowed.