There isn't, and strdup
isn't in the standard, either. You can of course just write your own:
int * intdup(int const * src, size_t len)
{
int * p = malloc(len * sizeof(int));
memcpy(p, src, len * sizeof(int));
return p;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…