Append string to another string : String Append « String « C / ANSI-C






Append string to another string

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

int main(void)
{
  char s1[80], s2[80];

  gets(s1);
  gets(s2);

  strcat(s2, s1);
  printf(s2);

  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: strncatAppend string: strncat
6.String concatenate
7. Append substring to string: strncat
8. Append string: how to use strcat Append string: how to use strcat