|
-
December 18th, 2006, 11:09 PM
#1
N/m
Last edited by SushiMania; December 19th, 2006 at 07:04 AM.
Reason: upDATED file
-
December 18th, 2006, 11:25 PM
#2
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
-
December 18th, 2006, 11:30 PM
#3
Re: Linked List problem!!!
sorry i don't even know how to use debugger.. and i am just stuck at that point...
-
December 18th, 2006, 11:34 PM
#4
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
-
December 18th, 2006, 11:34 PM
#5
Re: Linked List problem!!!
-
December 18th, 2006, 11:53 PM
#6
Re: Linked List problem!!!
Can anyone figure out the problem for mE?
Thank You
-
December 19th, 2006, 12:28 AM
#7
Re: Linked List problem!!!
dcjr84, have you figured out? Thank You
-
December 19th, 2006, 02:03 AM
#8
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
-
December 19th, 2006, 04:09 AM
#9
Re: Linked List problem!!!
Take a look at this sample linked list implementation : http://learningcppisfun.blogspot.com...nked-list.html
What compiler are you using?
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
-
December 19th, 2006, 04:32 AM
#10
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....
-
December 19th, 2006, 04:39 AM
#11
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?
 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.
Can you help me with my homework assignment?, Before you post!, Use code tags, How to post!, Codeguru technical FAQs, C++ FAQ Lite, Stroustrup: C++ Style and Technique FAQ, Guru of the Week, Comeau C and C++ FAQs, Comeau C++ Templates FAQs, CUJ @ DDJ, Spam threshold
My Blogs : Learning C++ is fun | Abnegator's reflections
Open Threads : C++ Aha! Moments | Nature of work in C++?
-
December 19th, 2006, 04:49 AM
#12
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...
-
December 19th, 2006, 05:35 AM
#13
Re: Linked List problem!!!
Can Somebody Please Help Me With This?
-
December 19th, 2006, 10:03 AM
#14
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()!
-
December 19th, 2006, 11:08 AM
#15
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|