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

Alan J Rosenthal flaps at dgp.toronto.edu
Mon Feb 1 19:28:53 AEST 2016


peter at ficc.uu.net (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.

ajr



More information about the Comp.lang.c mailing list