ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Firstly, post you code in code tags instead of quote tags (please edit your post). Secondly, [i]don't[i] add any characters to your code or the compiler output. Be verbatim! (edit that out too).
I assume you have added stars in pairs (baaad idea--use italics, bold or something similar to emphasize stuff you think it's needed).
So that raises the question: why do you want to cast the node to an int? What you might mean is to take the address of t (one spells that "&t").
I didn't get it. If the function takes TreeNode as the parameter and the parameter you are passing is also TreeNode, then why you are casting that variable to int???
Just pass the variable 't' into the function, i don't think you should cast it.
cppkid: actually, we're both wrong--you thought it was (TreeNode, TreeNode), I thought it was (TreeNode, TreeNode*). In fact (read the OP), it's (TreeNode*, TreeNode*).
Yes i noticed that, i just just wanted to put your attention that you didn't have to cast to someother datastructure... Anyway my fault that i didn't mentioned properly... Sorry for inconvinence...
thnx guys for the commens. I don't understand it myself why the author is casting that. Its just a complicated c code that we have to modify it for our project.... I tryed to understand it but its just to messy anyways the interesting thing is that it compiles at school with g++ 2.95 but not on my laptop's 4.01 ... is there anything i can do to compile it without changing the code...
thanks
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.