<分区>
Possible Duplicate:
How do I properly compare strings in C?
#include <iostream>
using namespace std;
int main(){
char name[100];
cout<<"Enter: ";
cin>>name;
if(name == "hello"){
cout<<"Yes it works!";
}
return 0;
}
为什么当我在提示中输入 hello 时,我没有得到“Yes it works!”消息?