STRCPY
Section: C Library Functions (3)
Index
Return to Main Contents
BSD mandoc
BSD 4
NAME
strcpy
- copy strings
SYNOPSIS
Fd #include <string.h>
Ft char *
Fn strcpy char *dst const char *src
Ft char *
Fn strncpy char *dst const char *src size_t len
DESCRIPTION
The
Fn strcpy
and
Fn strncpy
functions
copy the string
Fa src
to
Fa dst
(including the terminating
`\0'
character).
The
Fn strncpy
copies not more than
Fa len
characters into
Fa dst ,
appending
`\0'
characters if
Fa src
is less than
Fa len
characters long, and
not
terminating
Fa dst
if
Fa src
is more than
Fa len
characters long.
RETURN VALUES
The
Fn strcpy
and
Fn strncpy
functions
return
Fa dst .
EXAMPLES
The following sets
``chararray
''
to
``abc\0\0\0
''
(void)strncpy(chararray, "abc", 6).
The following sets
``chararray
''
to
``abcdef
''
(void)strncpy(chararray, "abcdefgh", 6);
SEE ALSO
bcopy(3),
memccpy(3),
memcpy(3),
memmove(3)
STANDARDS
The
Fn strcpy
and
Fn strncpy
functions
conform to
St -ansiC .
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- EXAMPLES
-
- SEE ALSO
-
- STANDARDS
-
This document was created by
man2html,
using the manual pages.
Time: 15:52:53 GMT, January 15, 2023