.\" Copyright 1995 James R. Van Zandt .\" .\" %%%LICENSE_START(VERBATIM) .\" 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. .\" %%%LICENSE_END .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Fri Dec 26 13:14:47 JST 1997 .\" by HIROFUMI Nishizuka .\" .TH STPCPY 3 2020\-06\-09 GNU "Linux Programmer's Manual" .SH 名前 stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインターを返す .SH 書式 .nf \fB#include \fP .PP \fBchar *stpcpy(char *\fP\fIdest\fP\fB, const char *\fP\fIsrc\fP\fB);\fP .fi .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBstpcpy\fP(): .PD 0 .ad l .RS 4 .TP 4 glibc 2.10 以降: _POSIX_C_SOURCE\ >=\ 200809L .TP glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .SH 説明 \fBstpcpy\fP() 関数は、\fIsrc\fP で指された文字列を (文字列を終端するヌルバイト (\(aq\e0\(aq) を含めて) \fIdest\fP で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る のに十分大きくなくてはならない。 .SH 返り値 \fBstpcpy\fP() は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインター (すなわち、文字列を終端するヌルバイト) を返す。 .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lb lb lb l l l. インターフェース 属性 値 T{ \fBstpcpy\fP() T} Thread safety MT\-Safe .TE .SH 準拠 この関数は POSIX.1\-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX システムの慣習的なものでもなかった。 この関数は Lattice C AmigaDOS コンパイラで初めて登場し、それは少なくとも 1986 年時点ではそうであった。 その後、 1989 年に GNU fileutils と GNU textutils に登場し、 1992 年までには GNU C ライブラリにも存在していた。 この関数は BSD 系にも存在する。 .SH バグ この関数はバッファー \fIdest\fP の範囲を行き過ぎてしまう可能性がある。 .SH 例 例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために \fBstpcpy\fP() を使用し、その後表示する。 .PP .EX #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); } .EE .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 プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。