.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1995 James R. Van Zandt .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH STPCPY 3 2012\-03\-15 GNU "Linux Programmer's Manual" .SH 名前 stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインタを返す .SH 書式 .nf \fB#include \fP .sp \fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBstpcpy\fP(): .PD 0 .ad l .RS 4 .TP 4 glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .SH 説明 \fBstpcpy\fP() 関数は、\fIsrc\fP で指された文字列を (文字列を終端する NULL バイト (\(aq\e0\(aq) を含めて) \fIdest\fP で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る のに十分大きくなくてはならない。 .SH 返り値 \fBstpcpy\fP() は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインタ (すなわち、文字列を終端する NULL バイト) を返す。 .SH 準拠 この関数は POSIX.1\-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX システムの慣習的なものでもなかったが、 GNU の発明というわけでもなかった。 ひょっとしたら MS\-DOS 由来のものかもしれない。 この関数は BSD 系にも存在する。 .SH バグ この関数はバッファ \fIdest\fP の範囲を行き過ぎてしまう可能性がある。 .SH 例 例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために \fBstpcpy\fP() を使用し、その後表示する。 .in +4n .nf #define _GNU_SOURCE #include #include int main(void) { char buffer[20]; char *to = buffer; to = stpcpy(to, "foo"); to = stpcpy(to, "bar"); printf("%s\en", buffer); } .fi .in .SH 関連項目 \fBbcopy\fP(3), \fBmemccpy\fP(3), \fBmemcpy\fP(3), \fBmemmove\fP(3), \fBstpncpy\fP(3), \fBstrcpy\fP(3), \fBstring\fP(3), \fBwcpcpy\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.41 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。