strcpy(3) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
STRCPY(3)                 NetBSD Programmer's Manual                 STRCPY(3)


NAME
strcpy, strncpy - copy strings
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <string.h> char * strcpy(char * restrict dst, const char * restrict src); char * strncpy(char * restrict dst, const char * restrict src, size_t len);
DESCRIPTION
The strcpy() and strncpy() functions copy the string src to dst (includ- ing the terminating `\0' character). The strncpy() copies not more than len characters into dst, appending `\0' characters if src is less than len characters long, and not termi- nating dst if src is more than len characters long.
RETURN VALUES
The strcpy() and strncpy() functions return 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), strlcpy(3)
STANDARDS
The strcpy() and strncpy() functions conform to ISO/IEC 9899:1999 (``ISO C99''). NetBSD 1.6.2 June 4, 1993 1
Powered by man-cgi (2024-03-20). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.