---
name: "al_cstr_dup"
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_cstr_dup"
---

# al\_cstr\_dup(3)

Allegro 5 API

## NAME

al\_cstr\_dup - Allegro 5 API

## SYNOPSIS

-

  ```
  #include <allegro5/allegro.h>
  char *al_cstr_dup(const ALLEGRO_USTR *us)
  ```

## DESCRIPTION

Create a NUL (`'\0'`) terminated copy of the string. Any embedded NUL bytes will still be presented in the returned string. The new string must eventually be freed with [al\_free(3)](/al_free/3.md).

If an error occurs NULL is returned.

## SEE ALSO

[al\_cstr(3)](/al_cstr/3.md), [al\_ustr\_to\_buffer(3)](/al_ustr_to_buffer/3.md), [al\_free(3)](/al_free/3.md)
