判断后一个字符串是否是前一个字符串的子串?帮忙填空
#include<stdio.h>#include<string.h>
#include<malloc.h>
void main()
{
char *p1, *p2;
int i, j, n = 0, leng;
p1 = (char *)malloc(100);
p2 = (char *)malloc(100);
scanf("%s%s", p1, p2);
printf("%s\t%s\n", p1, p2);
while (*p1 != *p2 && *p1 != '\0')
--------;
leng = strlen(p2);
while (*p2 != '\0' && *p1 != '\0')
{
if (*p1 == *p2)
----------;
p1++;
p2++;
}
printf("n=%d leng=%d\n", n, leng);
if (--------------)
printf("yes\n");
else
printf("no\n");
free(p1);free(p2);
}