p->link = q; , perhaps? It's hard to say with your little uninformative guessing game.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
> q->link = NULL;
Your struct doesn't contain a member called link ?
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
>sorry but that all the info that i have
No wonder you can't figure it out, you don't even know what the problem is!
>Your struct doesn't contain a member called link ?
Yea, I saw that too...no, really. :o ;)
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>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.
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>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?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
>maybe just maybe one of the experts out there could help me out.
No, sorry. We can make educated guesses (as I've already done), but you're simply not providing enough information. Go back to whoever gave you that code and tell them that you can't fill in a missing statement when you don't even remotely know how the statement is supposed to fit into the rest of the code. Here, this is a perfectly valid and correct answer to your question:
p = new NodeType;
p -> data = 18;
q = new NodeType;
q -> data = 32;
cout<<"Narue is kewl!\n";
q-> link = NULL;
Don't you see how absurd your request is?
Narue
Bad Cop
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
What Narue is trying to say is we can't just fill in any old line of code, we have to know what the code is supposed to accomplish, then we are able to figure out what the line is supposed to be.
In other words,
What is that line supposed to do? What makes you think a line is needed? When we know that, we can figure out what the line is.
WaltP
Posting Sage w/ dash of thyme
10,492 posts since May 2006
Reputation Points: 3,348
Solved Threads: 943