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:

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

* 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.