[Solved] Segmentation fault from sscanf in a loop in C
[ad_1] Using feof() is a bad idea as it can return zero, and then the next line of input can encounter end of the file – which can give unexpected errors Also fgets() returns NULL if an error occurs, including encountering end of file. Imagine your loop has been going along happily, and has just … Read more