strcpy, _fstrcpy

copy a string

Synopsis:

#include <string.h>
char *strcpy( char *dst, const char *src );
char __far *_fstrcpy( char __far *dst,
                      const char __far *src );

Description:

The strcpy() and _fstrcpy() functions copy the string pointed to by src (including the terminating null character) into the array pointed to by dst.

Copying of overlapping objects is not guaranteed to work properly. See the description for the memmove() function for information on copying objects that overlap.

The _fstrcpy() function is a data-model-independent form of the strcpy() function. It accepts far pointer arguments, and returns a far pointer. It is most useful in mixed memory model applications.

Returns:

the value of dst

See also:

strdup(), strncpy()

Examples:

#include <stdio.h>
#include <string.h>

void main()
  {
    char buffer[80];

    strcpy( buffer, "Hello " );
    strcat( buffer, "world" );
    printf( "%s\n", buffer );
  }

produces the output:

Hello world

Classification:

strcpy() is ANSI; _fstrcpy() is WATCOM.

Systems:

strcpy()
All (except DOS/PM)
_fstrcpy()
All (except Netware, DOS/PM)