Mega Code Archive

 
Categories / C / Code Snippets
 

Append substring to string strncat

#include <stdio.h> #include <string.h> int main () { char str1[20]; char str2[20]; strcpy (str1,"rntsoft.com"); strcpy (str2,"Superman"); strncat (str1, str2, 6); puts (str1); return 0; }