大哥们,帮忙查错
#include <stdio.h>#include <string.h>
int main()
{
FILE* fp;
char* p1=0;
char* op=0;
char* p=0;
fp=fopen("dictionary.txt","rt");
if(fp==0)
{
printf("找不到文件");
getch();
exit(1);
}
while(1)
{
printf("\n\n请输入关键字:");
scanf("%s ",p1);
while(!feof(fp))
{
fscanf(fp,"%s\n",op);
p=strstr(op,p1);
if(p!=0)
printf("%s\n",op);
op=0;
}
p1=0;
fseek(fp,0L,0);
printf("\n");
}
getch();
return 0;
}