Copyright (c) 1990 The Regents of the University of California.
All rights reserved.
%sccs.include.redist.man%
@(#)strdup.3 5.1 (Berkeley) 06/22/90
All rights reserved.
%sccs.include.redist.man%
@(#)strdup.3 5.1 (Berkeley) 06/22/90
STRDUP 3 ""
C 7 NAME
strdup - save a copy of a string
SYNOPSIS
#include <string.h> char * strdup(const char *str);
DESCRIPTION
Strdup allocates sufficient memory for a copy of the string
str , does the copy, and returns a pointer to it.
The pointer may subsequently be used as an argument to the function
free (3). Strdup returns NULL if unable to allocate the necessary memory.
SEE ALSO
malloc(3)