How Do I Make This Hard to Misuse?
Posted Apr 1, 2008 5:41 UTC (Tue) by
jzbiciak (
✭ supporter ✭, #5246)
Parent article:
How Do I Make This Hard to Misuse?
One of my favorite C APIs to love to hate: fputc(int, FILE *) and fgets(char *, int, FILE *)
Why is the file pointer the last argument?! As Rusty pointed out, "context" arguments such as handles (FILE * in this case) idiomatically belong at the front, just like in fprintf(FILE *, const char *, ...).
(
Log in to post comments)