Mail Archives: djgpp/2000/07/13/13:33:20
Steve Johnston <s DOT johnston AT coventry DOT ac DOT uk> wrote:
[...]
> At the moment I use fscanf() for the obtaining the values I want -
> is there any way I can get it to jump to the next line in the file
> once its read in one floating point value?
You could use
fscanf(file, "%d%*[^\n]%*[\n]", value);
But the usual approach to scanning line-oriented, 'free' format input
is not to use fscanf(), but instead fgets() to read in the text, a
line at a time, and then use sscanf() on the resulting string. fgets()
has the advantage that it does make a difference between line ends and
white space, unlike all but the most experienced users' scanf()
strings do.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -