I am having a weird problem with pointers .I am building a k-d tree for ray tracing and during the BuildKDtree function I print root->left and root->right and I get correct values for various attributes stored at node.
The moment I complete that code and then try to traverse the tree using the original root’s pointer the root->left and root->right values contain garbage and code crashes!
Any suggestions as to what might be causing this?
I could paste code if necessary but its quite clumsy.
I am having a weird problem with pointers .I am building a k-d tree
Share
What is the signature of the
BuildKDtreefunction? Is it possible that somewhere there is a pointer but what actually needed is a pointer-to-pointer? Just trying to guess 🙂