strcat

Appends a copy of one string to the end of a second string (function or macro)

Local Servers:nonblocking
Remote Servers:N/A
Classification:ANSI
Service:String Manipulation

Syntax

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

Parameters

dst
(OUT) Points to the string to which to append a copy of another string.
src
(IN) Points to the string to be copied.

Return Values

strcat returns the value of dst.

Remarks

The strcat function or macro appends a copy of the string pointed to by src (including the terminating NULL character) to the end of the string pointed to by dst. The first character of src overwrites the NULL character at the end of dst.

See Also

strncat

Example

  #include <string.h>  
   
  #include <stdio.h>  
  main ()  
  {  
     char    buffer[80];  
     strcpy (buffer, "Hello ");  
     strcat (buffer, "world");  
     printf ("%s\n", buffer);  
  }
  

produces the following:

  Hello world