need help solving a segmentation fault with file i/o in C
问题 I read the input file , which has 911 lines , and want to copy these 911 lines into the output file , after making a few changes to each line.. I am getting segmentation fault when i run this.. I dont know why.. can anyone please help.. #include<stdio.h> void main() { int i; FILE *fin,*fop;char* str; fin=fopen("atk561011.txt","r"); if(fin=NULL) printf("ip err"); fop=fopen("svmip.txt","w"); if(fop=NULL) printf("op err"); for(i=1;i<=911;i++) { fgets(str,150,fin); if((i>300&&i<=360)||(i>600&&i<