how to get pointer of pointer of a object in `C` -
i have struct variable
struct var var;
and function library
void func(struct var ** ){}
now want call function can use
func(&&var);
if so, there cautious? if not, solutions?
thanks!
a function argument of type t**
going reassigning pointer different value. means address of t*
must passed in:
struct var* var; func(&var); void func(struct var ** a_var) { *a_var = malloc(sizeof(struct var)); }
Comments
Post a Comment