On 5 Oct 2003 18:28:33 -0700,
ce****@transy.edu (Charles Erwin) wrote:
Is there any way, upon scanning in a file line by line to avoid
missing the last line if there is not a newline character (aka you
have to hit return on the last line of input in your file). I was
sure that there was a way around it but it escapes me if there is one.
I believe that it is one of those implementation-defined issues. A
text stream is composed of lines that end with a new-line character.
Whether the last line requires a new-line character is
implementation-defined. The standard requires the data read from a
text file to be identical to the data read into the file only if the
last character is a new-line character plus other restrictions on the
type of characters and on sequencing of spaces and new-lines
previously written into the file. So I do not think that the standard
can help you here.
You might try reading character by character or checking with your
implementation documents.
Best wishes,
Bob