I'm trying to implement my own strcat function for exercise 5-3 from K&Rs the C programming language. Here is what I have, which causes a seg fault.
#include <stdio.h>
void cat(char *st, char *end)
{
while(*st++);
while(*st++ = *end++);
}
int main()
{
char *start = "str";
char *end = "ing!";
cat(start, end);
printf("start = %s\n", start);
}