*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->NetBSD man pages -> strcpy (3)              
Title
Content
Arch
Section
 

STRCPY(3)

Contents


NAME    [Toc]    [Back]

     strcpy, strncpy - copy strings

LIBRARY    [Toc]    [Back]

     Standard C Library (libc, -lc)

SYNOPSIS    [Toc]    [Back]

     #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    [Toc]    [Back]

     The strcpy() and strncpy() functions copy the string src to dst (including
 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 terminating
 dst if src is more than len characters long.

RETURN VALUES    [Toc]    [Back]

     The strcpy() and strncpy() functions return dst.

EXAMPLES    [Toc]    [Back]

     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    [Toc]    [Back]

      
      
     bcopy(3), memccpy(3), memcpy(3), memmove(3), strlcpy(3)

STANDARDS    [Toc]    [Back]

     The strcpy() and strncpy() functions conform to .

BSD                              June 4, 1993                              BSD
[ Back ]
 Similar pages
Name OS Title
bcopy Linux copy byte strings
strccpy IRIX copy strings, compressing or expanding escape codes
xstr OpenBSD extract strings from C programs to implement shared strings
xstr NetBSD extract strings from C programs to implement shared strings
xstr Tru64 Extracts strings from C programs to implement shared strings
xstr FreeBSD extract strings from C programs to implement shared strings
xstr IRIX extract strings from C programs to implement shared strings
xstr HP-UX extract strings from C programs to implement shared strings
scp FreeBSD secure copy (remote file copy program)
scp OpenBSD secure copy (remote file copy program)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service