GDN:strdup

From LibrePlanet
Revision as of 15:46, 19 December 2013 by Dgumberg (talk | contribs) (Created page with "{{Infobox Function |header [[<string.h>]] |since C90 }} The strdup function copies the null-terminated string <code>s</code> into a newly allocated string. The string is all...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
The strdup function copies the null-terminated string s into a newly allocated string. The string is allocated using malloc If malloc cannot allocate space for the new string, strdup> returns a null pointer. Otherwise it returns a pointer to the new wide character string.

Contents

Prototype

<source lang="c">char * strdup (const char *s)</source>

GDN:strdup