#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void)
{
    char *s;
    char *t;
    char *r;
    s = "abc";
    t = "def";
    r = (char*)(malloc(strlen(s) + strlen(t) + 1));
    if(!r)
    {
          printf("fail\n");
          return 0;
    }
    strcpy(r,s);
    strcat(r,t);
    printf("%s\n",r);
    if(r != NULL)
    {
           free(r);
           r = NULL;
    }
    system("pause");
    return 0;
}