c/io/fread

Reads up to objects into the array  from the given input stream  as if by calling fgetc  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 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 feof and ferror to determine which occurred.