The dereference operator * gets the value that the pointer is pointing to.
The statement
*current = *current->next;
assigns from the object that current->next is pointing to, to the object that current is pointing to.
Now when you don't use the dereference operator:
current = current->next;
you assign the pointers, not the objects they point to.
After this assignment then you have two pointers both pointing to the same object.
It might be easier to understand if we draw it out using pen and paper. Draw an object using a rectangle, and label it appropriately. Then draw another rectangle and connect it to the first using an arrow.
This second rectangle is pointing to the first rectangle, just like a pointer does in C++.
By using the dereference operator * you follow the arrow to the first rectangle.
So lets say we have the object node:
+------+ | node | +------+
Then we create a pointer current that points to node:
+---------+ +------+ | current | --> | node | +---------+ +------+
When you use current you get the pointer itself. When you use *current you follow the arrow and get node.
*p = *qandp = qwherepandqare pointers?current = current->nextis the one you want. The other one is actually copying data around and overwriting stuff - not what you want.*operator before a pointer, dereferences the pointer, returns the value at the location pointed to by the pointer. Without the*operator, only the pointer contents are copied (not the thing pointed to by the pointer).*current = *current->next;seems like it will cause a memory leak.