65,210
社区成员
发帖
与我相关
我的任务
分享
char* strstrc(char* pp,char* pd)
{
char *sou = pp;
char *des = pd;
if(*sou == NULL||*pd ==NULL)
return sou;
while((*sou!=NULL)&&(*des!=NULL))
{
if(*sou==*des)
{
char* ts = sou;
char* td = des;
ts++;
td++;
while((*ts!=NULL)&&(*td!=NULL))
{
if(*ts==*td)
{
ts++;
td++;
}
else
break;
}
if(*td==NULL)
{
des = td;
break;
}
else
{
sou++;
}
}
else
{
sou++;
}
}
if(*des==NULL)
return pp;
return NULL;
}