strcat( ) in c

strcat() function in C concatenates the source string at the end of the target string

Example of strcat() in C

main( ) 
{ 
 char source[ ] = "Folks!" ; 
 char target[30] = "Hello" ; 
 strcat ( target, source ) ; 
 printf ( "\nsource string = %s", source ) ; 
 printf ( "\ntarget string = %s", target ) ; 
} 

Output

source string = Folks!
target string = HelloFolks!

Leave a Comment