I am trying to get my head around a basic linked list. All the nodes will be a simple int data value. I am not sure if I implemented the 2 classes correctly as when I run my code I should be getting 5 7 3 in the console but it's currently showing 0 0 0
Does that seem reasonable to you? Calling delete on a pointer, and then after that trying to do something with that pointer? Anything seem odd about that?
You need to stop guessing and think about what you're trying to do; think about what is actually being done when you're trying to delete the first node in the list.
First, you need to make head point to the SECOND node in the list. Then, you delete the first node.
why do i need to make it point to the 2nd node in the list if i am trying to delete the first?
Your list object, ListOfInts , is basically just a pointer to the first node in the list. It calls this pointer "head". Each node points to the next node in the list, so the ListOfInts object just needs to always know what the first node is.
So if ListOfInts ever stops pointing at the first node in the list, how can you ever get back any of the data? You can't.
So when you remove the first node from the list, what becomes the new first node in the list? What should ListOfInts be pointing at?