标题:大哥们,帮忙查错
取消只看楼主
djgpp
Rank: 2
等 级:论坛游民
帖 子:7
专家分:10
注 册:2010-3-6
结帖率:0
已结贴  问题点数:20 回复次数:0 
大哥们,帮忙查错
#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;
}

搜索更多相关主题的帖子: 输入关键字 include 大哥 
2010-06-19 21:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-310685-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.759827 second(s), 9 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved