.TH strdup() "" "" "String Function (libc)"
.PC "Duplicate a string"
.B "#include <string.h>"
\fBchar *strdup(\fIstring\^\fB)\fR
\fBchar *\fIstring\^\fB;\fR
.PP
The string function
.B strdup()
duplicates the text to which
.I string
points.
It calls
.B malloc()
to allocate memory for the duplicate, copies the string, and
returns a pointer to the memory that holds the copy.
If something goes wrong, it returns NULL.
.SH "See Also"
.Xr "libc," libc
.Xr "string.h" string.h
.SH Notes
.B strdup()
is not part of the \*(AS.
Using it in your programs may limit their portability.
