Home >>C String functions >C strcat() function

C strcat() function

C strcat() function

Strcat() function is used to concatenate two string.

Syntax:
Strcat(str1,str2)

Note:- Here str is given string.

Parameters:-

It takes string as parameter.

Return type:-

It returns modified string.

Example-1

#include <stdio.h>
#include <string.h>
int main( )
{
   char source[ ] = " fresh2refresh" ;
   char target[ ]= " C tutorial" ;
   strcat ( target, source ) ;
   printf ( "\nTarget string after concatenation = %s", target ) ;
}

Output:
Target string after concatenation=C tutorial fresh2refresh

No Sidebar ads