1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com>
5 .\" Permission is granted to make and distribute verbatim copies of this
6 .\" manual provided the copyright notice and this permission notice are
7 .\" preserved on all copies.
9 .\" Permission is granted to copy and distribute modified versions of this
10 .\" manual under the conditions for verbatim copying, provided that the
11 .\" entire resulting derived work is distributed under the terms of a
12 .\" permission notice identical to this one.
14 .\" Since the Linux kernel and libraries are constantly changing, this
15 .\" manual page may be incorrect or out-of-date. The author(s) assume no
16 .\" responsibility for errors or omissions, or for damages resulting from
17 .\" the use of the information contained herein. The author(s) may not
18 .\" have taken the same level of care in the production of this manual,
19 .\" which is licensed free of charge, as they might when working
22 .\" Formatted or processed versions of this manual, if unaccompanied by
23 .\" the source, must acknowledge the copyright and authors of this work.
25 .TH STPCPY 3 1995-09-03 "GNU" "Linux Programmer's Manual"
27 stpcpy \- copy a string returning a pointer to its end
30 .B #define _GNU_SOURCE
32 .B #include <string.h>
34 .BI "char *stpcpy(char *" dest ", const char *" src );
39 function copies the string pointed to by \fIsrc\fP
40 (including the terminating '\\0' character) to the array pointed to by
42 The strings may not overlap, and the destination string
43 \fIdest\fP must be large enough to receive the copy.
46 returns a pointer to the \fBend\fP of the string
47 \fIdest\fP (that is, the address of the terminating null byte)
48 rather than the beginning.
50 This function is not part of the C or POSIX.1 standards, and is
51 not customary on Unix systems, but is not a GNU invention either.
52 Perhaps it comes from MS-DOS.
54 For example, this program uses
56 to concatenate \fBfoo\fP and
57 \fBbar\fP to produce \fBfoobar\fP, which it then prints.
67 to = stpcpy(to, "foo");
68 to = stpcpy(to, "bar");
69 printf("%s\\n", buffer);
80 .BR feature_test_macros (7)