自己写的
char *string_in(char ch_ch[],char ch_find[])
{
int i,j;
int str_ch,str_find;
str_ch = strlen(ch_ch);
str_find = strlen(ch_find);
char * ch;
for(i = 0;i <= str_ch-str_find;i++)
{
for(j = 0;j <=str_find;j++)
{
if(ch_ch[i+j] == ch_find[j]) //比较两个字符是否相同
ch = &ch_ch[i+j];
else
{
ch = NULL;
break;
}
}
if(ch != NULL)
return (ch-(str_find-1));//如果ch_find被包含在ch_ch中,就返回ch_ch中ch_find的开始地址
}
return ch;
}