CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 15
  1. #1
    Join Date
    Dec 2006
    Posts
    15

    N/m

    as stated
    Last edited by SushiMania; December 19th, 2006 at 07:04 AM. Reason: upDATED file

  2. #2
    Join Date
    Sep 2005
    Location
    United States
    Posts
    799

    Re: Linked List problem!!!

    Have you tried using your debugger?

    It is extremely helpful when your program compiles fine, but does not behave as you expect it to.

    You can check variable values, and set breakpoints to stop your code execution at certain points to narrow down your problem to a more specific area of the code.
    Please rate my post if you felt it was helpful

  3. #3
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    sorry i don't even know how to use debugger.. and i am just stuck at that point...

  4. #4
    Join Date
    Sep 2005
    Location
    United States
    Posts
    799

    Re: Linked List problem!!!

    * Sigh *

    I am starting to think that my college is the only one in the United States (perhaps the world) that teaches people how to use their debugger to solve coding problems.

    Perhaps I am just expecting too much, but I just can't see how you could possibly learn how to program without knowing how to use a debugger.

    It just doesn't make any sense. They go hand in hand.

    There is no possible way I could have passed any of my upper level/advanced computer science courses without knowing how to use a debugger. So it kinda makes me scratch my head when someone tells me they don't know how to use one.

    In any case, perhaps I will take a look. No guarantees though.
    Last edited by dcjr84; December 18th, 2006 at 11:38 PM.
    Please rate my post if you felt it was helpful

  5. #5
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    thx man...

  6. #6
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    Can anyone figure out the problem for mE?
    Thank You

  7. #7
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    dcjr84, have you figured out? Thank You

  8. #8
    Join Date
    Dec 2006
    Posts
    166

    Re: Linked List problem!!!

    some changes that should make it work:
    *1st case should only test "*head == NULL" and not the other condition
    *while loop should test for "while(temp)"
    *3rd case should insert into "prev->next" instead of "temp->next"

    in fact, 1st case can be combined into the 2nd case; and 3rd case can be combined into the 4th case, if you want

    also, you can eliminate 1st/2nd cases if you insert a dummy node at the front; but this is your choice

  9. #9
    Join Date
    Feb 2005
    Location
    "The Capital"
    Posts
    5,306

  10. #10
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    Well... i got it working, but i am facing few other problems now... it won't write more than two names if there's space between name( such John Smith). Also after exiting program and excuting program again to edit, it won't display right, also it won't write back to file....

  11. #11
    Join Date
    Feb 2005
    Location
    "The Capital"
    Posts
    5,306

    Re: Linked List problem!!!

    I asked about your compiler and you did not answer. There should be a debugger with it. Also, I don't understand : when you say it is working - what is working? what is not working? what part of code does what?
    Quote Originally Posted by SushiMania
    Well... i got it working, but i am facing few other problems now... it won't write more than two names if there's space between name( such John Smith). Also after exiting program and excuting program again to edit, it won't display right, also it won't write back to file....
    Can you put cout statements to see what is happening? Check each of the variables. After reading and writing and print the list as soon as it is modified to see if that is okay. You should be able to narrow down to the code that is causing the problem.

  12. #12
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    Okay i updated the file, and also i am using visual studio 2005 .... and i do not know how to use debugger... i am sorri, but i never learned how to use it... maybe after the finals.. i will... thx a lot for carin guys...

  13. #13
    Join Date
    Dec 2006
    Posts
    15

    Re: Linked List problem!!!

    Can Somebody Please Help Me With This?

  14. #14
    Join Date
    Feb 2005
    Location
    Normandy in France
    Posts
    4,590

    Re: Linked List problem!!!

    Currently, your code is unavailable... If other want to help, you've to post your code or attach it to one of your messages.
    "inherit to be reused by code that uses the base class, not to reuse base class code", Sutter and Alexandrescu, C++ Coding Standards.
    Club of lovers of the C++ typecasts cute syntax: Only recorded member.

    Out of memory happens! Handle it properly!
    Say no to g_new()!

  15. #15
    Join Date
    Sep 2000
    Location
    Indianapolis
    Posts
    6,758

    Re: Linked List problem!!!

    Seems that the original poster removed his original post. As such, there is not further value to this thread for anyone. I've closed it.

    Please do not remove the original questions after they have been answered or responded to. Others may find value in them.

    Thanks,

    Brad!
    -----------------------------------------------
    Brad! Jones,
    Yowza Publishing
    LotsOfSoftware, LLC

    -----------------------------------------------

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