static char* strstr(char* haystack, char* needle)
{
for(;;++haystack) {
char *h = haystack;
for(char *n = needle;; ++n,++h) {
if(!*n) return haystack;
if(*h != *n) break;
}
if(!*h) return NULL;
}
}
strstr函数实现
最新推荐文章于 2022-03-11 15:40:55 发布