I have a linked list with three Persons: "Tom", "Dick", and "Harry". Each Person is stored in a PersonNode with a pointer to another PersonNode.
As you can see, the organization goes like this:
Tom->Dick->Harry.
By default, the "nextNode" pointer is set to NULL in a constructor. I coded my program to output the names of Tom, Dick, and Harry. When I run the code, it prints Harry's name, and then the "while" loop continues. Thus, Visual Studio complains about an access violation immediately thereafter.
Did you try using a debugger to inspect the values as the program runs? Something is probably not set up the way you think it is and a debugger can help you find out what.
Did you check to see how it gets set to that? 0xCDCDCD looks like Visual Studio's uninitialized pointer value. Are you sure the constructor is working like it should?