#include <iostream>
#include <string>
#include <cstring>
using namespace std;
int main(){
string a="asdasd";
if(!strchr(a,'a')) cout<<"yes";
return 0;
}
我刚开始学习 C++ 编程,我不知道为什么我在这行出现错误
if(!strchr(a,'a')) cout<<"yes";
但是如果我尝试像这样编写它,它会运行得很好。
if(!strchr("asdasd",'a')) cout<<"yes";
我知道这是一个愚蠢的问题,但我真的不知道为什么..对不起..