But I get an error saying that btree isn't initialized if I don't set it to NULL. I'm still fairly new to C++, so sorry about the basic questions. Thanks for the help guys!
I wanted to practice using recursion using trees. I am aware of the pre, in, and postrder traversal, it's just I keep having problems with display them to the screen.
Also thanks for the AddNode function! It IS much easier!
Thanks Volatile, I kept looking at my Print function. I didn't think to completely go over my add function again. C++ is definitely a challenge (a good challenge). Thanks again!
The language itself isn't. Logically thinking about taking what you know and translating it into code is typically the hard part. A lot of programmers start off by learning how to convert plain english, the thoughts that run through your head (or, if you're learning to be a programmer or a good programmer, the words you speak to yourself), write up pseudo code, then translate pseudo code into C++. Pseudo code is essentially a mix between all programming languages and english (or whatever language you write in). It allows you to, depending on your skills with pseudo code, to simply write out each line into C++ and watch the flow of the thoughts that you had turn into code. It's quite magnificent if you ask me.
I wish I could help you a little bit more with this code specifically, but I've never done a tree before (surprisingly, I know), but one of these days I'll look at it. I believe it works just like a list, but instead of going front to end, a tree starts in the middle and moves out, adding larger elements to the right, smaller ones to the left. I don't like the idea behind it, because, as you've noticed, it's not the easiest thing to implement.
Good luck, and if I see anything else I can help you with, I'll be sure to try.