c语言结构要在函数内部初始化的时候参数为什么要传二级指针?
比如需要这么写:
void f(anystruct **a)
{
*a = calloc(1,sizeof(anystruct));
}
而不能写成:
void f(anystruct *a)
{
a = calloc(1,sizeof(anystruct));
}
void f(anystruct **a)
{
*a = calloc(1,sizeof(anystruct));
}
而不能写成:
void f(anystruct *a)
{
a = calloc(1,sizeof(anystruct));
}
...全文


