Newsgroups: comp.lang.c Path: utzoo!utgpu!jarvis.csri.toronto.edu!champlain.dgp!flaps From: flaps@dgp.toronto.edu (Alan J Rosenthal) Subject: arg order for fgets() (was: Re: Re^2: scanf(..)) Message-ID: <1989Jun19.175414.430@jarvis.csri.toronto.edu> Organization: Dynamic Graphics Project, University of Toronto References: <225800176@uxe.cso.uiuc.edu> <11831@bloom-beacon.MIT.EDU> <4734@freja.diku.dk> <4529@ficc.uu.net> peter@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