]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Hey Emacs! This file is -*- nroff -*- source. |
2 | .\" | |
3 | .\" Copyright 1995 James R. Van Zandt <jrv@vanzandt.mv.com> | |
4 | .\" | |
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. | |
8 | .\" | |
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. | |
13 | .\" | |
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 | |
20 | .\" professionally. | |
21 | .\" | |
22 | .\" Formatted or processed versions of this manual, if unaccompanied by | |
23 | .\" the source, must acknowledge the copyright and authors of this work. | |
24 | .\" | |
25 | .TH STPCPY 3 1995-09-03 "GNU" "Linux Programmer's Manual" | |
26 | .SH NAME | |
27 | stpcpy \- copy a string returning a pointer to its end | |
28 | .SH SYNOPSIS | |
29 | .nf | |
30 | .B #define _GNU_SOURCE | |
31 | .br | |
32 | .B #include <string.h> | |
33 | .sp | |
34 | .BI "char *stpcpy(char *" dest ", const char *" src ); | |
35 | .fi | |
36 | .SH DESCRIPTION | |
37 | The \fBstpcpy()\fP function copies the string pointed to by \fIsrc\fP | |
38 | (including the terminating `\\0' character) to the array pointed to by | |
39 | \fIdest\fP. The strings may not overlap, and the destination string | |
40 | \fIdest\fP must be large enough to receive the copy. | |
41 | .SH "RETURN VALUE" | |
42 | \fBstpcpy()\fP returns a pointer to the \fBend\fP of the string | |
43 | \fIdest\fP (that is, the address of the terminating null character) | |
44 | rather than the beginning. | |
45 | .SH EXAMPLE | |
46 | For example, this program uses \fBstpcpy\fP to concatenate \fBfoo\fP and | |
47 | \fBbar\fP to produce \fBfoobar\fP, which it then prints. | |
48 | .nf | |
49 | ||
50 | #include <string.h> | |
51 | ||
52 | int | |
53 | main (void) | |
54 | { | |
55 | char *to = buffer; | |
56 | to = stpcpy (to, "foo"); | |
57 | to = stpcpy (to, "bar"); | |
58 | printf ("%s\\n", buffer); | |
59 | } | |
60 | .fi | |
61 | .SH "CONFORMING TO" | |
62 | This function is not part of the ANSI or POSIX standards, and is | |
63 | not customary on Unix systems, but is not a GNU invention either. | |
64 | Perhaps it comes from MS-DOS. | |
65 | .SH "SEE ALSO" | |
66 | .BR bcopy (3), | |
67 | .BR memccpy (3), | |
68 | .BR memcpy (3), | |
69 | .BR memmove (3), | |
70 | .BR strcpy (3) |