标签:strstr
模拟实现strstr函数
int main() { char *p1,*p2; char a1[]="abbbcd"; char a2[]="bcd"; p1=a1; p2=a2; while(*p1!=‘\0‘); { if(*p1!=*p2) { p1++; if(p2!=a2) p2=a2; } else { p1++; p2++; } } if(*p2==‘\0‘) printf("Exist\n"); else printf("Not exist !\n"); system("pause"); return 0; }
本文出自 “sunshine225” 博客,请务必保留此出处http://10707460.blog.51cto.com/10697460/1753591
标签:strstr
原文地址:http://10707460.blog.51cto.com/10697460/1753591