cpp/io/c/fread

Reads up to objects into the array  from the given input stream  as if by calling std  times for each object, and storing the results, in the order obtained, into the successive positions of, which is reinterpreted as an array of. The file position indicator for the stream is advanced by the number of characters read.

If the objects are not, the behavior is undefined.

If an error occurs, the resulting value of the file position indicator for the stream is indeterminate. If a partial element is read, its value is indeterminate.

Return value
Number of objects read successfully, which may be less than if an error or end-of-file condition occurs.

If or  is zero,  returns zero and performs no other action.

does not distinguish between end-of-file and error, and callers must use std and std to determine which occurred.