Append substring to string: strncat : String Append « String « C / ANSI-C






Append substring to string: strncat



#include <stdio.h>
#include <string.h>

int main ()
{
  char str1[20];
  char str2[20];

  strcpy (str1,"qqq34567790");
  strcpy (str2,"333333");
  strncat (str1, str2, 6);

  puts (str1);
  return 0;
}
           
       








Related examples in the same category

1.Demonstrates how to put strings together using strcat
2.Get first and last name and print them together
3.Join strings
4.Join strings: revitalised: strlen and strcat
5.Append string to another string
6.Append string: strncatAppend string: strncat
7.String concatenate
8. Append string: how to use strcat Append string: how to use strcat