strcat(): Concatenation of strings in C

#include <stdio.h>
#include <string.h>
int main(void){
char var1[20]="plus2net";
char var2[]="welcome to ";
strcat(var2,var1);
printf(var2);
return 0;
}
The output of above code is here
welcome to plus2net
We can use string function strcat() to concatenate strings.
The second string is added at the end of the first string.
Syntax
strcat(destination_string, source_string);
  • Source string is not affected
  • Source string is added at the end of the destination string.


plus2net.com






We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles Contact us
©2000-2025   plus2net.com   All rights reserved worldwide Privacy Policy Disclaimer