# %fputc() function

The %fputc() function writes the character
specified by *character* on the named output *stream*.

## Syntax

```
var = %fputc(character, (char*)stream)
```

## Description

Note: The character is passed
as a number. Normal usage overrides the type (see the example below).

If successful, the character is returned as a number, otherwise
eof (-1) is returned.

If the character is contained in a FlashBASIC
dynamic array, an explicit (char) type override
must be used, otherwise a pointer would be passed to the C function.

## Example(s)

```
c=’a’
n=%fputc((char)c, (char*) strm)
```

## See also

- [%fclose() function](https://d3codex.com/pickbasic-flashbasic/percent-fclose-function/)
- [%fopen() function](https://d3codex.com/pickbasic-flashbasic/percent-fopen-function/)
- [%fprintf() function](https://d3codex.com/pickbasic-flashbasic/percent-fprintf-function/)
- [%fputs() function](https://d3codex.com/pickbasic-flashbasic/percent-fputs-function/)
- [FlashBASIC C functions overview](https://d3codex.com/pickbasic-flashbasic/flashbasic-c-functions-overview/)
- [cfunction statement](https://d3codex.com/pickbasic-flashbasic/cfunction-statement/)

---
Source: https://d3codex.com/pickbasic-flashbasic/percent-fputc-function/ - part of the D3Codex reference.
