Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site emory.UUCP Path: utzoo!linus!decvax!harpo!floyd!clyde!akgua!emory!kim From: kim@emory.UUCP (Kim Wallen ) Newsgroups: net.lang.c Subject: EOF with fgets() Message-ID: <1185@emory.UUCP> Date: Mon, 31-Oct-83 21:14:50 EST Article-I.D.: emory.1185 Posted: Mon Oct 31 21:14:50 1983 Date-Received: Thu, 3-Nov-83 09:19:01 EST Organization: Math & Computer Science, Emory University, Atlanta Lines: 18 From:!sb1!sb6!emory!kim I have been trying to use fgets() to read lines from a file inside a while loop which tests to see if fgets() returns a NULL. The lines are read in and the loop seems to terminate, but I always get an illegal instruction error at the end of main(). I have tried using fscanf() and checking for EOF, but get the same error. Any guidance on how I can get a line scanning program to terminate correctly at the end of a file would be greatly appreciated. Kim Wallen Psychology Dept. Emory University Atlanta, GA 30322 !sb1!sb6!emory!kim