I have a program that reads student names and grades line by line from a .txt file using fgets and a buffer declared as:
char buffer[1024];
Now the file should end with the string "end" on a line all by itself.
How do I tell a while loop to terminate when buffer == "end"?
I tried using strcmp but it segfaults for some reason.
strcmpis the right function to use, it must be something else.strcmpsegfaults rather than avoiding the issue.