hello,
i made a simple app that searches a small sized file for example 100 lines, finds a word you want it to find and prints the whole line that has that word
when i try big files, it shows up the "Please tell Microsoft about this problem." error.Code:#include <stdio.h> #include <string.h> int main(){ char a[100]; FILE *fin=fopen("in.txt","r"); FILE *fout=fopen("out.txt","w"); while(fgets(a,sizeof(a),fin)!=NULL){ if (strstr(a,"someword")){ fprintf(fout,"%s\n",a);} } fclose(fin); fclose(fout); return 0; }
i searched but couldnt find anything, would appreciate any help provided.
thanks



LinkBack URL
About LinkBacks



