3.2.14. fwrite

Writes the contents of a buffer to a file or window.

Syntax

unsigned long fwrite (buffer, count, size, outputid)
void *buffer;
unsigned count;
unsigned size;
int outputid;

where:

buffer

Specifies the start of the area from which the data is read.

count

Specifies the number of elements.

size

Specifies the size of each element in bytes.

outputid

The ID number of a window or file where the data is to be written. This must be a user-defined windowid or fileid.

Description

This macro writes the contents of a buffer to a file or window. You must define the identity of the file with either the fopen macro or the FOPEN command.

Return value

unsigned long

The size of the data that is written, and is the same as size * count.

Rules

If you are writing to a file, it must be opened in write mode, for example: fopen(100,"c:\\myfiles\\data_out.txt","w").

Example

The example on Example also shows you how to use fwrite in a macro.

See Also

Copyright © 2002-2011 ARM. All rights reserved.ARM DUI 0175N
Non-ConfidentialID052111