#include <stdio.h>size_t fread(void *buf, size_t size, size_t count, FILE *stream);
The fread( ) function reads count number of objects, each object being size bytes in length, from the stream pointed to by stream and stores them in the array pointed to by buf. The file position indicator is advanced by the number of characters read.
In C99, buf and stream are qualified by restrict.
The fread( ) function returns the number of items actually read. If fewer items are read than are requested in the call, either an error has occurred or the end of the file has been reached. You must use feof( ) or ferror( ) to determine what has taken place.
If the stream is opened for text operations, certain character translations, such as carriage return/linefeed sequences being transformed into newlines, may occur.
Related functions are fwrite( ), fopen( ), fscanf( ), fgetc( ), and getc( ).