Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!nrl-cmf!ukma!gatech!uflorida!haven!ncifcrf!nlm-mcs!adm!xadmx!rbj@nav.icst.nbs.gov From: rbj@nav.icst.nbs.gov (Nilbert T Bignum) Newsgroups: comp.unix.wizards Subject: Unix problem or C problem? Message-ID: <18366@adm.BRL.MIL> Date: 13 Feb 89 16:59:19 GMT Sender: news@adm.BRL.MIL Lines: 14 ? As an aside, I generally avoid testing scanf() values against EOF. scanf() ? returns the number of successful assignments (1 in this case), so you may ? be a lot safer saying: ... I agree. In fact, I would avoid testing the return value of scanf or fscanf against *anything*. Don't use them at all. Use fgets followed by sscanf. If you don't like the input on a particular line, it is easier to throw it away by doing another fgets than by constructing a scanf expression to read `any string terminated by newline but only up to this many characters into that junk buffer over there'. On another point, you may want to rescan the input somehow. Nilbert T Bignum NTSI: Never Twice the Same Institute