Re: io:lines() and 0円
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: io:lines() and 0円
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2014年2月20日 15:22:27 -0300
> In case I did not explain myself. No production libC I've ever looked
> at does fgets with a getc loop, I knew this. But all the ones I
> remember using give the same result ( as chars stored in the buffer,
> not counting buffer overflows, EOF checking and the errors I'm sure
> to introduce now ) for 'fgets(buf, size, file)' and
> 'while((c=getc(f)!='\n' && c!=EOF) *buf++=c; *buf=0;', and that is
> what I meant for equivalent.
ANSI C explicitly demands that:
7.19.3 Files
11. [...] The byte input functions read characters from the stream as if
by successive calls to the fgetc function.
-- Roberto
- References:
- Re: io:lines() and 0円, Craig Barnes
- Re: io:lines() and 0円, Sean Conner
- Re: io:lines() and 0円, René Rebe
- Re: io:lines() and 0円, René Rebe
- Re: io:lines() and 0円, Sean Conner
- Re: io:lines() and 0円, Francisco Olarte
- Re: io:lines() and 0円, Enrico Colombini
- Re: io:lines() and 0円, Francisco Olarte
- Re: io:lines() and 0円, Luiz Henrique de Figueiredo
- Re: io:lines() and 0円, Francisco Olarte