ustrdup(3alleg)

ustrdup3alleg

Duplicates a string. allegro game programming library.

Usage

#include <allegro.h>

char *ustrdup(const char *src)

Overview

This functions copies the null-terminated string `src' into a newly allocated area of memory, effectively duplicating it. Example:

   void manipulate_string(const char *input_string)
   {
      char *temp_buffer = ustrdup(input_string);
      /* Now we can modify temp_buffer */
      ...

Return value

Returns the newly allocated string. This memory must be freed by the caller. Returns NULL if it cannot allocate space for the duplicated string.

Releases

4 releases since Debian 3.1 (Sarge); the text changed 2 times.

  1. 3.1
  2. 4.0
  3. 5.0–6.0

From liballegro-doc 2:4.2.2-2.2 in Debian 6.0 (Squeeze). Parsed by carta from the page's man source.