fread
fread is a standard C library function that reads data from a file stream into memory. It is declared in stdio.h as size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream).
The function reads up to nmemb elements, each of size bytes, from the stream into the array
fread is binary-safe in the sense that it reads raw bytes without interpreting them. However, on platforms
To distinguish between end-of-file and error, use feof and ferror. On error, errno may be set. fread