程序的段错误,core dumped,求帮助!
#include<stdio.h>char *Src="/home/haiy/Desktop/tst.data";char *Des="/home/haiy/Desktop/des.data";void main(){ FILE *fp=NULL; char str[100]; /* if(argc<2) printf("Usage:gets_puts <source_file_name> <detination_file_name>!\n"); else{ Src=argv[1]; printf("source file is %s,\n target file is %s\n",Src,Des); } */ printf("This is a tst program!\n"); fp=fopen(Src,"r"); if(fp==NULL) printf("%s open error!\n",Src); else while(feof(fp)==0){ fputs(fgets(str,10,fp),stdout); } fclose(fp);