实验10_4_设计函数 locatesubstr char *locatesubstr(char *str1,char *str2) { int s,j,len,m; len = strlen(str1)-strlen(str2); m = strlen(str2); //去掉’\n’的匹配 char * sptr; for(sptr=str1; *sptr!='\0'; sptr++) if (strncmp(sptr,str2,m)==0) return (sptr); return (NULL); }