arg order for fgets() (was: Re: Re^2: scanf(..))

Alan J Rosenthal flaps at
Mon Feb 1 19:28:53 AEST 2016

peter at (Peter da Silva) writes:
>[ By the way, it really bugs me that stdio is so inconsistant about the
>  position of the inevitable 'stream' argument? In an ideal world that code
>  would read "fgets(stdin, buffer, sizeof buffer)", no? ]

I think the order in which the functions were invented is important here.  I
believe that fprintf is more recent than many other stdio (portable C library?)
functions.  Other functions taking a stream argument tend to put it at the end
(putc, ungetc, fgets).  This would have been really annoying for fprintf though.


More information about the Comp.lang.c mailing list