# %fgetc() function

The %fgetc() function returns the next
character from the named input *stream*.

## Syntax

```
var = %fgetc((char*)strea)m
```

## Description

The character is returned as
a number. Normal usage would override the type (see the example below).
The getc() and getchar() system
functions cannot be used because they are macros, rather than functions.

## Example(s)

```
c=(char)%fgetc((char*) stream)
crt c
```
Note the character type casting to override the default
(int) type.

## See also

- [%fclose() function](https://d3codex.com/pickbasic-flashbasic/percent-fclose-function/)
- [%fgets() function](https://d3codex.com/pickbasic-flashbasic/percent-fgets-function/)
- [%fopen() function](https://d3codex.com/pickbasic-flashbasic/percent-fopen-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-fgetc-function/ - part of the D3Codex reference.
