struct ANIMAL
{
int *a;
int *b;
}
void f(struct ANIMAL **mAnimal)
{
(*mAnimal) = (struct ANIMAL*)calloc(1,sizeof(struct ANIMAL) + 10*(sizeof(int)));
}
struct ANIMAL animal;
struct ANIMAL* panimal = &animal;
f(&panimal); // 出错
要怎么才能获得里面的指针??
你的
sizeof
写错了, 不是sizof
.