好的,请仔细检查下面的代码,它只是函数的一部分
void RepeatWord(){
system("cls");
string word = NULL;
string newword = NULL;
int repeats = 0;
while(true){
if(word == NULL){
cout<<"Currently no word is stored..";
cout<<"\n\nPlease enter a word: ";
cin>>word;
}
....
好吧,我一直在使用其他编程语言,我总是在与一个NULL
值进行比较,但是在 C++ 中……这似乎是一种不同的情况。错误说..
错误:'word == 0' 中的 'operator==' 不匹配
好吧,我想知道我只是在与 a 进行比较NULL
,我真的不知道为什么这是错误的。将值与 aNULL
与 C++ 进行比较是否不同?请教我。谢谢
注意:我比 java 更了解 ruby