www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/11/02/23:50:34

Sender: nate AT cartsys DOT com
Message-ID: <363E8AA3.2728F716@cartsys.com>
Date: Mon, 02 Nov 1998 20:46:27 -0800
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.05 [en] (X11; I; Linux 2.0.35 i486)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: File I/O in C++/C
References: <363E0FC0 DOT EF92F165 AT mayn DOT de>
Reply-To: djgpp AT delorie DOT com

Christian Herold wrote:
> 
> Hello!
> 
> Is the fscanf-function as good as any other function (like fgets) for
> file input? Or are there any disadvantages?

The right tools for the right job.  `fscanf' is good for reading bits of
ASCII data from a text file, if it's in some pre-determined format. 
It's not so good if the input format is fuzzy, since it can be thrown
way off if something it expects isn't where you expect it.  Sometimes
`fgets' with `sscanf' can help.  And, of course, it's of very little use
when reading binary files.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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