Question: Suppose I have a doubly-linked list that has a pointer to the first node called "first." Now suppose that I want to create a function for this doubly-linked list that removes the "first" node (suppose the function accomplishes what's been done in the second picture; namely, a new pointer node has been declared as the previous first and first has been iterated once). Now my question is: if I delete the new first, does first's PREV now point to NULL? If not, what does it point to? Essentially, I want to know if I need to explicitly define first->PREV = NULL or whether deleting the new first will accomplish the same task.

Note: if it's not clear, up arrows are for PREV and down arrows are for NEXT.

![enter image description here](https://i.stack.imgur.com/6HCJt.jpg)

Answer: 
You're probably accessing memory outside the bounds of an array or which you didn't allocate. As such, you triggered **undefined behaviour**, so pretty much anything can happen, including crashing or even *apparently* working fine.
When creating/initialising your linked list's nodes make sure to explicitly initialise the node's member `pright` to `NULL`.