fwrite

Syntax

int fwrite(void buffer, int size, int numitems, void file)

Arguments

buffer
A pointer to the data buffer containing the data you want to write to the file.
size
The size of the data blocks you want to write out (eg if writing 32-bit integers, you might set this to 4 bytes).
numitems
The number of blocks of data you want to write to the file (eg number of integers you want to write to the file in a row).
file
The pointer/handle to the already opened file you want to write to.

Return

Returns the number of items that were successfully written to the file.

Description

Writes data to a previously opened file or stream.

Example

Also see

fopen, fread, fclose

Comments