hello;
i am trying to write my own version of strcat() that uses pointers. i dont know why its not working; can someone take a look at this piece of code?
thanks in advance
Code:#include <stdio.h>
char *my_strcat(char *a, char *s_a);
int main(void){
char x1[30] = "a";
char x2[10] = "boy";
my_strcat(x1, x2);
printf("%s", x1 );
}
char *my_strcat(char *a, char *b){
while (*a++ != '\0');
while(*b != '\0'){
*a++ = *b++;
}
*a = '\0';
return a;
}