.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" Copyright 1995 James R. Van Zandt .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Fri Dec 26 13:14:47 JST 1997 .\" by HIROFUMI Nishizuka .\" .\" 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. .\" .TH STPCPY 3 2011-09-28 "GNU" "Linux Programmer's Manual" .\"O .SH NAME .SH 名前 .\"O stpcpy \- copy a string returning a pointer to its end stpcpy \- 文字列をコピーし、コピーした文字列の終りへのポインタを返す .\"O .SH SYNOPSIS .SH 書式 .nf .B #include .sp .BI "char *stpcpy(char *" dest ", const char *" src ); .fi .sp .in -4n .\"O Feature Test Macro Requirements for glibc (see .\"O .BR feature_test_macros (7)): glibc 向けの機能検査マクロの要件 .RB ( feature_test_macros (7) 参照): .in .sp .BR stpcpy (): .PD 0 .ad l .RS 4 .TP 4 .\"O Since glibc 2.10: glibc 2.10 以降: _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L .TP .\"O Before glibc 2.10: glibc 2.10 より前: _GNU_SOURCE .RE .ad .PD .\"O .SH DESCRIPTION .SH 説明 .\"O The .\"O .BR stpcpy () .\"O function copies the string pointed to by \fIsrc\fP .\"O (including the terminating null byte (\(aq\\0\(aq)) to the array pointed to by .\"O \fIdest\fP. .\"O The strings may not overlap, and the destination string .\"O \fIdest\fP must be large enough to receive the copy. .BR stpcpy () 関数は、\fIsrc\fP で指された文字列を (文字列を終端する NULL バイト (\(aq\\0\(aq) を含めて) \fIdest\fP で指された配列にコピーする。 文字列は重複してはならず、コピー先の文字列 \fIdest\fP はコピーを受け取る のに十分大きくなくてはならない。 .\"O .SH "RETURN VALUE" .SH 返り値 .\"O .BR stpcpy () .\"O returns a pointer to the \fBend\fP of the string .\"O \fIdest\fP (that is, the address of the terminating null byte) .\"O rather than the beginning. .BR stpcpy () は、文字列 \fIdest\fP の始まりではなく \fB終り\fPを指すポインタ (すなわち、文字列を終端する NULL バイト) を返す。 .\"O .SH "CONFORMING TO" .SH 準拠 .\"O This function was added to POSIX.1-2008. Before that, it was not part of .\"O the C or POSIX.1 standards, nor customary on UNIX systems, but was not a .\"O GNU invention either. Perhaps it came from MS-DOS. It is also present on .\"O the BSDs. この関数は POSIX.1-2008 に追加された。 それ以前は、この関数は C や POSIX.1 標準の一部でも UNIX システムの慣習的なものでもなかったが、 GNU の発明というわけでもなかった。 ひょっとしたら MS-DOS 由来のものかもしれない。 この関数は BSD 系にも存在する。 .\"O .SH EXAMPLE .SH 例 .\"O For example, this program uses .\"O .BR stpcpy () .\"O to concatenate \fBfoo\fP and .\"O \fBbar\fP to produce \fBfoobar\fP, which it then prints. 例として、このプログラムは \fBfoo\fP と \fBbar\fP を連結して \fBfoobar\fP を作るために .BR stpcpy () を使用し、その後表示する。 .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\\n", buffer); } .fi .in .\"O .SH BUGS .SH バグ .\"O This function may overrun the buffer .\"O .IR dest . この関数はバッファ .I dest の範囲を行き過ぎてしまう可能性がある。 .\"O .SH "SEE ALSO" .SH 関連項目 .BR bcopy (3), .BR memccpy (3), .BR memcpy (3), .BR memmove (3), .BR stpncpy (3), .BR strcpy (3), .BR string (3), .BR wcpcpy (3)