比如我有:如何在C中的char数组中搜索字符串?
char buff[1000];
我想如果搜索字符串“hassasin”是在字符数组。这是我尝试过的。
char word[8] = "hassasin";
char Buffer[1000]=sdfhksfhkasd/./.fjka(hassasin)hdkjfakjsdfhkksjdfhkjh....etc
int k=0;
int t=0;
int len=0;
int sor=0;
for (k=0; k<1000; k++){
for (t=0; t<8; t++){
if (Buffer[k]==word[t]) len++;
if (len==8) "it founds 0.9.1"
}
}
你应该尝试编写自己的代码,然后询问如果你没”成功。 – Maroun
我试过但我找不到真正的答案 – hassasin
我不知道我遇到过多少次“关闭......这个问题不太可能对未来的访问者有所帮助”,答案非常有帮助。 – Dermot