strecpy

Copies a string and returns a pointer to its end.

Library:LibC
Classification:Linux
Service:Characters and Strings

Syntax

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

Parameters

dst

(OUT) Points to the array into which to copy the string.

src

(IN) Points to the string to be copied.

Return Values

Returns a pointer to the null-terminating character at the end of the dst string.

Remarks

The strecpy function build strings easier and faster than the strcpy function and sets you up for the next string copy. It is equivalent to the following:

  strcpy (dst, src);
  len = strlen (dst);
  dst+=len;
  

The src and dst strings cannot overlap. The dst buffer must be large enough for the src string, including the null-terminating character.

See Also