I'm trying to make a function similar to strcat(char,char) in string.h header file. Somehow this code does not catenate the strings. Please help me make it better.
void strappend(char *a, char *b)
{
int i;
int start_pos = strlen(a);
for (i=0; b[i]!='\0'; i++)
{
a[start_pos + i] = b[i];
}
a[i] = '\0';
}
Thanks in advance!