[juliantec_list] Re:Re:请帮忙看看这段程序为什么老是报告段错误

  • From: hetao21182 <hetao21182@xxxxxxx>
  • To: 第三人 <th3rd_person@xxxxxxx>
  • Date: Fri, 21 Oct 2011 10:11:17 +0800 (CST)

>
>段错误一般都是内存访问方面的问题了
>检查下吧
>

是 fgets 的问题么?看不出来。

我该了下程序:

void del(FILE *fp1,FILE *fp2,char *str1){       char str2[500]; long int size;  
memset(str2,0,500);     fseek(fp1,0,SEEK_END);  size=ftell(fp1);        
fseek(fp1,0,SEEK_SET);  while(!feof(fp1))       {               
fgets(str2,size,fp1);           if((strstr(str2,str1))!=NULL)           {       
                continue;               }               fputs(str2,fp2);        
}       fclose(fp1);    fclose(fp2);}




Learning, Just As Your Favourite Thing!

Maillist, See http://www.juliantec.info/mlist/mail-lists.html
JulBlog, See http://www.juliantec.info/julblog/summary.php
JulWiki, See http://www.juliantec.info/wiki/




Other related posts: