|
-
November 11th, 2008, 09:36 AM
#31
Re: Transferring Structure variables?(simple problem)
You're passing buddy to nodeCount rather than root in treeNodeCount. This would be a strange but valid choice except for one thing: binaryTreeType<elemType>::buddy is never modified in makeTree, since it is shadowed by the local variable called buddy.
Just pass root in treeNodeCount.
-
November 11th, 2008, 05:22 PM
#32
Re: Transferring Structure variables?(simple problem)
The exe still crashes. :/
and I deleted the local buddy variable, changed it to root, and it still crashes. What gives?
-
November 11th, 2008, 06:34 PM
#33
Re: Transferring Structure variables?(simple problem)
 Originally Posted by pyromonki
The exe still crashes. :/
and I deleted the local buddy variable, changed it to root, and it still crashes. What gives?
Now is the time to go step-by-step using the debugger on an unoptimized "debug" build.
Regards,
Paul McKenzie
-
November 12th, 2008, 09:40 AM
#34
Re: Transferring Structure variables?(simple problem)
I figured it out. I went back and realized the two problems:
1. I was using llink and rlink in the class functions, yet they were never defined, so there were no values, I replaced them with left, and right that I used to build the tree, and deleted the initialization of them.
2. The biggest problem of them all was, instead of putting the #include"treeimp.cpp" at the bottom of the header, I needed to put it in the test file.
After I did that, it worked perfectly. 
I didn't think about it, until I went back and reread some posts, especially the one where Lindley said the problem was that all the class defining files need to be linked.
The only one that wasn't "connected" was the test file, so I put the header made out of the implementation file there.
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
|