www.delorie.com/djgpp/doc/libc-2.01/libc_606.html   search  
Go to the first, previous, next, last section, table of contents.


strdup

Syntax

#include <string.h>

char * strdup (const char *source);

Description

Returns a newly allocated area of memory that contains a duplicate of the string pointed to by source. The memory returned by this call must be freed by the caller.

Return Value

Returns the newly allocated string, or NULL if there is no more memory.

Example

char *foo()
{
  return strdup("hello");
}


Go to the first, previous, next, last section, table of contents.

  prev next   webmaster     delorie software   privacy  
  Copyright © 1997     Updated Apr 1997