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.
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.
Re: Segmentation Error in program... Cant Figure out why
Quote:
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
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?