I have a doubly linked list and I know it gets created with the proper values. For some reason when I run through my print function it, only prints 1/2 of the list and then gives me this:

the instruction at "0x7c93426d" referenced memory at "0x00000000". the memory could not be "read".

I'm assuming it's trying to reference a NULL pointer but I dont know how 1/2 the list gets printed and the other 1/2 all of a sudden is NULL. Are there any common problems associated with printing linked lists like this?

Thanks

Recommended Answers

All 3 Replies

Also, btw, when I change the number of elements in the list and attempt to print that it works.. strange.

Post the code which
- creates nodes
- adds them to the list
- prints the list.

There's nothing strange when it's implemented correctly, so I'm just going with there are bugs in your code.

Hey sorry. You were right and I was implementing it incorrectly. I was passing a NULL pointer to my print function and it crashed. Thanks for the input.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.