I've look @ ever example and went over the chapter on linked structures / linked list, however I just can't figure it out!!! Help
thanks for your time.
Last edited by WaltP; Mar 4th, 2007 at 2:06 pm. Reason: CODE tags mussing, too...
I have this problem that I can't figure out, I can't figure out the line
statement that needs to go in.
Here's the problem
struct NodeType
{
int data;
NodeType* link;
};
NodeType* p;
NodeType* q;
p = new NodeType;
p->data = 18;
q = new NodeType;
q->data = 32;
<-- statement missing here
q->link = NULL;
I've look @ ever example and went over the chapter on linked structures / linked list, however I just can't figure it out!!! Help
thanks for your time.
I fix the link part any responses
Last edited by Narue; Mar 3rd, 2007 at 6:44 pm. Reason: Closed the quote tag
>I fix the link part any responses
Um, good for you? You still haven't specified enough of a problem to be solvable. You tell us what the code is supposed to be doing, and we'll tell you why it isn't working. Until then, get used to not having any useful responses.
>I fix the link part any responses
Um, good for you? You still haven't specified enough of a problem to be solvable. You tell us what the code is supposed to be doing, and we'll tell you why it isn't working. Until then, get used to not having any useful responses.
If I knew then I wouldn't be asking for your help, now would I ?
Buit thanks for looking anyway
>If I knew then I wouldn't be asking for your help, now would I ?
There's a significant difference between knowing the problem and knowing the cause of the problem. Not the least of which being that I'm talking about the former and you're talking about the latter. Do you go to a doctor and just tell him to heal you? Do you go to a mechanic and tell him to fix any problems he finds? No, you go to a doctor when you're injured or ill, and can tell him where it hurts. You go to a mechanic when your car makes a funny noise that you can describe to the mechanic.
I'm the doctor, tell me where it hurts. I'm the mechanic, describe the noise you're hearing. Then I'll use my expertise to help you correct the problem. Now, what part of that are you having trouble understanding?
>If I knew then I wouldn't be asking for your help, now would I ?
There's a significant difference between knowing the problem and knowing the cause of the problem. Not the least of which being that I'm talking about the former and you're talking about the latter. Do you go to a doctor and just tell him to heal you? Do you go to a mechanic and tell him to fix any problems he finds? No, you go to a doctor when you're injured or ill, and can tell him where it hurts. You go to a mechanic when your car makes a funny noise that you can describe to the mechanic.
I'm the doctor, tell me where it hurts. I'm the mechanic, describe the noise you're hearing. Then I'll use my expertise to help you correct the problem. Now, what part of that are you having trouble understanding?
again, like I said before, I needed to fill in the missing statement, however, I couldn't figure it out.
[B]fill in this line of the missing statement.[/B]
q-> link = NULL;
that was my question, I didn't know if they are looking for. Thats why I purposed the question, maybe just maybe one of the experts out there could help me out.
Thanks for you r time anyway.
Have a good day!
Last edited by WaltP; Mar 4th, 2007 at 2:09 pm. Reason: CODE tags again....
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.