This wiki is out of date, use the continuation of this wiki instead

Fwrite

From FenixWiki

(Difference between revisions)
Jump to: navigation, search

Revision as of 23:36, 12 June 2007


Contents

Definition

INT fwrite ( <INT filehandle> , <VOID data> )

Writes data to a file loaded with fopen.

Parameters

INT filehandle - Identifier of the file loaded with fopen.
VOID data - The data to write to the file (any type of variable).

Returns

INT : The number of bytes written to the file.

Example

Process writething(STRING loadpath);
Private
    handle;   // handle for the loaded file 
    druppels; // the data to write to the file

Begin

    druppels=rand(1,10);

    handle=fopen(loadpath,O_WRITE); // opens the file in writing mode
    fwrite(handle,druppels);        // writes the druppels variable to the file
    fclose(handle);                 // zipping up after business is done

End

Used in example: fopen(), fclose(), rand()

Personal tools