|
|
|
|
|
by Joker_vD
45 days ago
|
|
Shouldn't you be using cppreference.com instead of cplusplus.com? Because the former [0] actually has this language: Reads up to "count" objects into the array "buffer" from the given input stream "stream"
as if by calling fgetc "size" times for each object, and storing the results, in the order
obtained, into the successive positions of buffer, which is reinterpreted as an array of
"unsigned char".
This whole fread/fwrite's interface is hailing from the time where some OSes used record-based filesystems and were literally unable to read/write less than a record at a time.[0] https://en.cppreference.com/c/io/fread |
|
That description also fits what I saw in the implementations I inspected, both of which simply try to read size × count bytes.