change pointer passed by value

You would need to use a pointer to a pointer:

foo(struct node **n) 

To change what n points to, you do:

*n = t;

Leave a Comment