3.2.7. fputc

Writes a byte to a file.

Syntax

int fputc (byte,fileid)
int byte;
int fileid; 

where:

byte

The byte to be written.

fileid

The ID number of the file where the next byte is to be written. This must be a user-defined fileid. See Window and file numbers for details.

Description

This macro writes the contents of the next byte to a file. You must define the identity of the file with either the fopen macro (see fopen on fopen) or the FOPEN command (see FOPEN on FOPEN). You can also specify the Standard I/O window (20) as output.

Return value

int

Not used.

Rules

The file written to 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 fputc in a macro.

See also

The following macros provide similar or related functionality:

The following commands provide similar or related functionality:

Copyright © 2005, 2006 ARM Limited. All rights reserved.ARM DUI 0284C
Non-Confidential