int * intdup(int const * src, size_t len) { int * p = malloc(len * sizeof(int)); memcpy(p, src, len * sizeof(int)); return p; }