#include #include char *strdup(char const *s) { size_t len = strlen(s) + 1; char *copy = malloc(len); if(copy) memcpy(copy, s, len); return copy; }