CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Segmentation Error in program... Cant Figure out why

    ptr points to the node you're going to remove. You know this isn't the first node by that point, so you need to make sure that the node before ptr links to the node after ptr. You are not doing that, although you clearly meant to; you just didn't write the statement correctly.

  2. #17
    Join Date
    Nov 2010
    Posts
    23

    Re: Segmentation Error in program... Cant Figure out why

    Thank you, I think i get it,
    One more thing,

    You think you can show me exactly where i need to change it at?
    I'm still a bit confused, and I'm trying to find it in the book but i just don't get it.

  3. #18
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Segmentation Error in program... Cant Figure out why

    Quote Originally Posted by youngyou4 View Post
    You think you can show me exactly where i need to change it at?
    I'm still a bit confused, and I'm trying to find it in the book but i just don't get it.
    You need not look in a book, unless you don't know what a linked list is or how it's supposed to work, or you don't know how pointers work.

    If you wrote the program yourself, you should know what each and every line is/was supposed to do, else you wouldn't have written those lines of code. If you don't know what you're doing each and every step of the way when you write a program, then the program shouldn't be written and you need to review your books as to what you're asking the compiler to accomplish.

    If there is a bug (and all of us have written programs that have bugs), then you should diagnose how that bug appeared, and how to fix it -- once again, because you wrote the program with a purpose and goal in mind.

    Regards,

    Paul McKenzie
    Last edited by Paul McKenzie; November 3rd, 2010 at 02:09 PM.

  4. #19
    Join Date
    Nov 2010
    Posts
    1

    Re: Segmentation Error in program... Cant Figure out why

    Could you provide a compilable version of your program and show me what you got so far?

Page 2 of 2 FirstFirst 12

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