The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

strcpy - copy a string

 SYNOPSIS



#include <string.h>

char *strcpy(char *s1, const char *s2);

 DESCRIPTION

The strcpy() function copies the string pointed to by s2 (including the terminating null byte) into the array pointed to by s1. If copying takes place between objects that overlap, the behaviour is undefined.

 RETURN VALUE

The strcpy() function returns s1; no return value is reserved to indicate an error.

 ERRORS

No errors are defined.

 EXAMPLES

None.

 APPLICATION USAGE

Character movement is performed differently in different implementations. Thus overlapping moves may yield surprises.

This issue is aligned with the ISO C standard; this does not affect compatibility with XPG3 applications. Reliable error detection by this function was never guaranteed.

 FUTURE DIRECTIONS

None.

 SEE ALSO

strncpy(), <string.h>.

DERIVATION

Derived from Issue 1 of the SVID.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]