Unsolved Segmentation Fault
So, I'm getting a segmentation fault I can't solve. I have this code, with print statements to show where the program quits.
And the print looks like this:
i = 0;
printf("Host name %s : %i \n i is %i\n", hostCon[i].hostName, hostCon[i].freq, i);
fprintf(host_freq, "%i\n", hostCon[i].freq);
fprintf(host_name, "%s", hostCon[i].hostName);
printf("out of for loop");
Host name *******.com
i is 1999
It seems odd to me, because after the "hi2" the while loop should be finished, thus the next print statement should I appear. I don't understand how this segmentation fault occurs when there is nothing in between the two print statements. Let me know if more code is necessary to debug this. Thanks in advance.