Do you need help understanding the difference?
Imagine a calling function in the first case:
IntElement *head; int data; ... insertInFront (head, data);
Now in this case, the address pointed to by the head is pushed onto the stack and passed as an argument to insertInFront. When insertInFront does head = newElement; only the argument is changed (on the stack).
In the second case, the caller will be:
IntElement *head; int data; ... insertInFront (&head, data);
In this case, the chapter address is pushed onto the stack and passed as an argument to insertInFront. When you do * head = newElement, it is a de-link passed to the address to get the address of the original chapter of the list, and this is a change.
source share