tail head cat sleep
QR code linking to this page

manページ  — STRDUP

名称

strdup – 文字列のコピーを保存

内容

ライブラリ

Standard C Library (libc, -lc)

書式

#include <string.h>

char *
strdup(const char *str);

解説

strdup() 関数は、文字列 str のコピーのために十分なメモリを割り当て、コピーを行い、 コピーへのポインタを返します。ポインタは後で関数 free(3) の引数として使ってください。

利用可能なメモリが十分ではない場合、NULL を返します。

関連項目

free(3), malloc(3)

歴史

strdup() 関数は、 BSD 4.4 ではじめて登場しました。

STRDUP (3) June 9, 1993

tail head cat sleep
QR code linking to this page


このマニュアルページサービスについてのご意見は Ben Bullock にお知らせください。 Privacy policy.

“ Do you laugh when the waiter drops a tray full of dishes? Unix weenies do. They're the first ones to laugh at hapless users, trying to figure out an error message that doesn't have anything to do with what they just typed. ”
— The Unix Haters' handbook