CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 33

Threaded View

  1. #16
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: A task involving linked lists and a headache

    I didn't try and compile and run your code, but a quick check still shows this problem that I mentioned previously.
    Code:
    		if(Head==NULL)
    		{
    			InList->Cur=NewBunny;
    			InList->Next=Head; This is wrong
    As to what's wrong with your loop, each time you delete a node, your list gets smaller. Your loop variable i doesn't account for that. You really shouldn't be forcing array constructs onto a list anyway.

    Did you try debugging yet?
    Last edited by GCDEF; October 1st, 2012 at 01:53 PM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured