• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Doubly Linked List

Page 2 - Seeking answers? Join the AnandTech community: where nearly half-a-million members share solutions and discuss the latest tech.
Hm, that gives me a different answer.. the screen fills up with 14's. I'll look into my pointers to make sure they're done properly. Thanks a lot though, I really appreciate all of your help guys.
 
Originally posted by: reverend boltron
Hm, that gives me a different answer.. the screen fills up with 14's. I'll look into my pointers to make sure they're done properly. Thanks a lot though, I really appreciate all of your help guys.

Beggarking is right that the OR should be an AND. Look at my above post.
 
Originally posted by: igowerf
Originally posted by: reverend boltron
Hm, that gives me a different answer.. the screen fills up with 14's. I'll look into my pointers to make sure they're done properly. Thanks a lot though, I really appreciate all of your help guys.

Beggarking is right that the OR should be an AND. Look at my above post.

Yeah, actually, if you look at my post you'll see that I grasped what Beggarking said. I drew it out and it makes perfect sense. So now I'm just looking through my pointers and seeing if they're all being kept track of properly. Because now I'm at least getting information instead of a crash. Which is definitely a plus.
 
Hey! You're brilliant! Good job! Now I've got another error, but still, I'm past that part. Thank you so much man. Seriously, I really do appreciate this.
 
Sorry to keep on asking questions, but I'm having problems with the destructor. The whole program is working fine, it's just messing up when it is calling the destructor.

Like, according to the test program, it works fine, and everything prints out just fine and dandy, except that it crashes at the end.

Edit: Nevermind, I just fixed it. Seriously guys, thanks so much for your help. I really appreciate it.
 
🙂 glad to be of help.

btw, the destructor should be

current = first->next
// keep deleting until all nodes in the list are gone
while (current->Next->next != NULL)
DeleteCurrent();
// then delete the dummy first node, too
delete First;
delete Last;
 
Back
Top