fwrite
From cppreference.com
| Defined in header <stdio.h>
|
||
| (until C99) | ||
| (since C99) | ||
Writes count of objects from the given array buffer to the output stream stream. The objects are written as if by reinterepreting each object as an array of unsigned char and calling fputc size times for each object to write those unsigned chars into stream, in order. The file position indicator for the stream is advanced by the number of characters written.
Parameters
| buffer | - | pointer to the first object in the array to be written |
| size | - | size of each object |
| count | - | the number of the objects to be written |
| stream | - | pointer to the output stream |
Return value
The number of objects written successfully, which may be less than count if an error occurs.
If size or count is zero, fwrite returns zero and performs no other action.