fread

Syntax

int fread(void* buffer, int size, int numitems, void* file)

Arguments

buffer
A pointer to the data buffer where the data read from the file will be stored.
size
The size of the data blocks you want to read from the file (eg if reading 32-bit integers, you might set this to 4 bytes).
numitems
The number of blocks of data you want to read from the file (eg number of integers you want to read from the file in a row).
file
The pointer/handle to the already opened file you want to read from.

Return

Returns the number of items that were successfully read from the file.

Description

Reads data from a previously opened file or stream.

Example

Also see

fopen, fread, fclose

Comments