|
|
|
|
|
by kazinator
4011 days ago
|
|
getc should in fact be reading all pixels in a single read() under the hood, and just pulling characters from a buffer. ISO C stdio streams are fully buffered, when not connected to interactive devices. Moreover, getc is often a macro which inlines the code of pulling a character out of the stream's buffer and updating a pointer, triggering the refill as needed. In my experience, using getc is usually not too terrible compared to writing buffering code to do the same thing. (I certainly wouldn't say someone was a bad programmer or academic for writing the code around getc. On the other hand, if they assigned the return value of getc to a char typed variable, I'd have a different opinion! :) |
|