Older Newer
Wed, 24 May 2017 05:07:16 . . . . SyneRyder [These should be void pointers (I think?)]
Fri, 18 Jun 2010 18:30:02 . . . . SyneRyder

Changes by last author:

= fwrite =

== Syntax ==

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

== Arguments ==


::A pointer to the data buffer containing the data you want to write to the file.


::The size of the data blocks you want to write out (eg if writing 32-bit integers, you might set this to 4 bytes).


::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).


::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 ==

* The size and numitems parameters can be confusing - it's often easier to set the size parameter to the number of bytes you want to write to the file, and keep the numitems parameter set to 1.