delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/10/09/07:04:17

From: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>
Organization: Materials Science Centre
To: djgpp AT delorie DOT com
Date: Wed, 9 Oct 1996 11:42:01 GMT
Subject: differences in what [f|s|]scanf() returns
Message-ID: <7B87792A1F@fs2.mt.umist.ac.uk>

  Teun Burgers <burgers AT ecn DOT nl> wrote (Subject: Re: f2c for version 2):-
> ... You need to change about fscanf() in format.c, i.e.
> from:     if (fscanf (infile, "%d", &token) == EOF)
> to:     if (fscanf (infile, "%d", &token) == NULL)
> Because return value of fscanf() of V2 is different from UNIX ...

Oh indeed!?!?!? Qu'vatlh!!! And I recently wrote and allowed out a C++ program
that relies on sscanf() returning n if it managed to read the 1st to nth of
the values that it was supposed to read! Which C's and C++'s do treat fscanf()
sscanf() scanf() this way? And which otherwise, and what do they do here?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019