Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!cernvax!ethz!lubich From: lubich@ethz.UUCP (Hannes Lubich) Newsgroups: comp.lang.c Subject: Help Message-ID: <408@ethz.UUCP> Date: Sun, 16-Nov-86 12:27:02 EST Article-I.D.: ethz.408 Posted: Sun Nov 16 12:27:02 1986 Date-Received: Sun, 16-Nov-86 21:12:42 EST Organization: CS Department, ETH Zuerich, Switzerland Lines: 26 Well, I'm trapped. When using something like : while (fgets (teststring, 100, myfptr) != NULL) if (do_something_with_string (teststring)) { fclose (myfptr); return 1; } fclose (myfptr); return 0; I get 'Illegal instruction' when returning (both 1 and 0), if the filesize is greater than 0 (but the string which is read from file is correct). When the filesize is 0 the return works correct but it's not too useful then. Furthermore when I declare teststring as : char teststring[]; the above result appears but when I try to declare it as char *teststring; I get a 'Bus error' at once. Could somebody give me a hint about that misterious 'fgets' ? Thanks Hannes {known world}!cernvax!ethz!lubich