---
name: "al_fungetc"
section: "3"
platform: "linux"
package: "allegro"
version: "5.2.11.3-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/al_fungetc"
---

# al\_fungetc(3)

Allegro 5 API

## NAME

al\_fungetc - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  int al_fungetc(ALLEGRO_FILE *f, int c)
  ```

## DESCRIPTION

Ungets a single byte from a file. Pushed-back bytes are not written to the file, only made available for subsequent reads, in reverse order.

The number of pushbacks depends on the backend. The standard I/O backend only guarantees a single pushback; this depends on the libc implementation.

For backends that follow the standard behavior, the pushback buffer will be cleared after any seeking or writing; also calls to [al\_fseek(3)](/al_fseek/3.md) and [al\_ftell(3)](/al_ftell/3.md) are relative to the number of pushbacks. If a pushback causes the position to become negative, the behavior of [al\_fseek(3)](/al_fseek/3.md) and [al\_ftell(3)](/al_ftell/3.md) are undefined.

## SEE ALSO

[al\_fgetc(3)](/al_fgetc/3.md), [al\_get\_errno(3)](/al_get_errno/3.md)
