I have this function:
What I want is to find the lines in my file that start with an "A". But for some reason this function is only finding the first line that starts with "A", and after it, the error message "segmentation fault" appears. Can someone help me please? Thanks!
FILE *f_simulation = NULL;
if((f_simulation = fopen("simulation.txt", "r"))==NULL)
printf("Can't open file %s", "simulation.txt");
while(fgets(line, DIML, f_simulation)!= NULL)
vn = fgets(line, DIML, f_simulation);
if(vn == 'A')