---
name: "pack_ungetc"
section: "3alleg"
platform: "linux"
package: "liballegro-doc"
version: "2:4.2.2-2.2"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/pack_ungetc"
---

# pack\_ungetc(3alleg)

Moves one single character back to the input buffer. Allegro game programming library.

## NAME

pack\_ungetc - Moves one single character back to the input buffer. Allegro game programming library.

## SYNOPSIS

**#include \<allegro.h\>**

**int pack\_ungetc(int c, PACKFILE \*f);**

## DESCRIPTION

Puts a character back to the file's input buffer. Like with ungetc from libc, only a single push back is guaranteed.

Note: pack\_fgets internally uses pack\_ungetc, so never use pack\_ungetc directly after using pack\_fgets on a PACKFILE.

## RETURN VALUE

Returns c on success, or EOF on error.

## SEE ALSO

[**pack\_getc**(3alleg)](/pack_getc/3alleg.md), [**pack\_fgets**(3alleg)](/pack_fgets/3alleg.md)
