Implementation of append_str
void append_str
(char **s, const char *t) {
if (*s) {
*s = realloc(*s,
strlen(*s) + strlen(t) + 1);
strcat (*s, t);
} else {
*s = malloc(strlen(t) + 1);
strcpy(*s, t);
}
}
Previous slide
Next slide
Back to first slide
View graphic version