Arjan <
arjan.v...@rivm.nl> schrieb:
> Is it "a feature" that if you read a character string with format
> "*" then reading continues across multiple lines until it finds
> more than just spaces, CR or LF?
In short: Yes.
Somewhat longer: If you want to be pedantic, it is actually the
end of a record (which is usually defined by a combination of CR
and LF on modern systems). List-directed input (with the format
as *) is more geared towards interactive use, where you usually
don't want to read an empty line if the user just hits Enter.
When doing I/O from files, it is usually better to use formatted
I/O, or to read on whole lines into character variables and then
do I/O them; you can then use list-directed input more safely.
C's scanf() shares this "feature", by the way.