> Can you tell me which is the preferred way?
Both are valid, and both are useful.
> Which one is used more often... The return statement or by reference to an argument?
I'd go for the return, but that's just me.
> The pointer we want is *head???
Thats it, you would say
Code:
ll_node *new_node = malloc( sizeof( ll_node ) );
// some code which decides new_node should be the head
*head = new_node;
It's all about counting & and *'s - an & (indirection) in the caller function has to be balanced by a *(dereference) in the called function, in order to update the caller's variable.