I am having trouble concatenating strings in C, without strcat library function. Here is my code
#include #include #include<
You can do it using strcpy() too ;)
char *a = (char *) malloc(100); char *b = (char *) malloc(100); strcpy(a, "abc"); // initializes a strcpy(b, "def"); // and b strcpy((a + strlen(a)), b); // copy b at end of a printf("%s\n",a); // will produce: "abcdef"