Possible Duplicate:
In Visual Studio C++, what are the memory allocation representations?
Sorry about the Title but i realy dont know how i handle this "value=???"
got a simple binary tree with a treeIterator. The iterator can go up and down with ++ or --
It contains a value and a key also the root node, left node, right node.
if i start a iterator on a tree
for (Map::TreeIterator i=tree.begin(); i != tree.end(); i++) {
std::cout << i.key() << ": " << i.value() << std::endl;
}
the iterator calls begin()
TreeIterator Tree::begin() {
return TreeIterator(m_root->findFirst());
}
calls findFirst()
TreeNode* TreeNode::findFirst() {
if (m_left != NULL) {
return m_left->findFirst();
} else {
return this;
}
}
all right if the tree contains a lot of values. Now I clear the tree, print out the Count and try to start a iterator to look if there are items show them, anyways...
try to debug shows the iterator goes into the propably empty tree and looks for elements. he got the root Node from the tree, which is a Zero Node, take the left Node (also a Zero Node) and run findFirst on the left Node.
Here we go, the left Node (Zero Node) of the root (Zero Node) has no left Node.
m_left=??? m_right=??? m_up=???
so i have default contructor, which will set all nodes to a Zero Node (should i need this? it's allways the default contructor, right?)
Finaly, my problem is how can i handle this problem? maybe catch a exception? the whole thing throws a unhandled exception at memory xxx
Thanks for answers