---
name: "al_fwrite"
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_fwrite"
---

# al\_fwrite(3)

Allegro 5 API

## NAME

al\_fwrite - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  size_t al_fwrite(ALLEGRO_FILE *f, const void *ptr, size_t size)
  ```

## DESCRIPTION

Write \`size' bytes from the buffer pointed to by \`ptr' into the given file.

Returns the number of bytes actually written. If an error occurs, the return value is a short byte count (or zero).

## SEE ALSO

[al\_fputc(3)](/al_fputc/3.md), [al\_fputs(3)](/al_fputs/3.md), [al\_fwrite16be(3)](/al_fwrite16be/3.md), [al\_fwrite16le(3)](/al_fwrite16le/3.md), [al\_fwrite32be(3)](/al_fwrite32be/3.md), [al\_fwrite32le(3)](/al_fwrite32le/3.md)
