|
-
November 3rd, 2010, 01:06 PM
#16
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.
-
November 3rd, 2010, 01:14 PM
#17
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.
-
November 3rd, 2010, 02:02 PM
#18
Re: Segmentation Error in program... Cant Figure out why
 Originally Posted by youngyou4
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.
-
November 4th, 2010, 02:16 PM
#19
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?
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|