Consistency is fundamental property in a code base, let alone in a programming language that eventually turned out to be the most used in the world.
There are two families of I/O functions in C: formatted and unformatted. These are:
int fprintf(FILE *stream, const char *format, ...);
int vfprintf(FILE *stream, const char *format, va_list ap);
And
int fputc(int c, FILE *stream);
int fputs(const char *s, FILE *stream);
int putc(int c, FILE *stream);
*fprintf
seems to go for the (where, what)
ordering whereas *put*
for (what, where)
; same holds for input functions. Why is the stream
parameter at different positions? Are there any historical/design motivations for such choice?