Sujet : Re: Buffer contents well-defined after fgets() reaches EOF ?
De : noone (at) *nospam* noone.net (Andrey Tarasevich)
Groupes : comp.lang.cDate : 09. Feb 2025, 16:27:26
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <voahgv$mdud$2@dont-email.me>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On Sat 2/8/2025 11:13 PM, Janis Papanagnou wrote:
But now I wanted to ignore all data that I got for fgets() != NULL
in the loop. And I hoped that *after* the loop the last read data is
still valid.
As Michael already noted it depends on what you consider as the last piece of valid data in your file. Say, what do you want to see as "the last line" in a file that ends with
abracadabra\n<EOF here>
?
Is "abracadabra" the last line? Or is the last line supposed to be empty in this case?
-- Best regards,Andrey