Reads a specified number of items from the file.
#include <stdio.h> size_t fread (void *ptr, size_t size_of_item, size_t number_items, FILE *file_ptr);
typedef unsigned int size_t
The reading begins at the current location in the file. The items read are placed in storage beginning at the location given by the first argument. You must also specify the size of an item, in bytes.
If the file pointed to by file_ptr was opened in record mode, fread will read size_of_item multiplied by number_items bytes from the file. That is, it does not necessarily read number_items records.
n | The number of bytes read divided by size_of_item. |
0 | Indicates the end-of-file or an error. |