I need some more help with this program,
from main...
Code:
BST Original;
Original.Insert (X);
Original.Insert (Y);
Original.InOrder (cout);
I think the insertion works alright but when I get to InOrder it fails. Here's the function...
Code:
void BST::InOrder (ostream &x)
{
InOrderTraversal (Root, x);
}
void BST::InOrderTraversal (TreePtr root, ostream & file)
{
if (root)
{
InOrderTraversal (root->Left, file); <----- here's the error
file << root->Info.Name << endl;
InOrderTraversal (root->Right, file);
}
}
The error message I'm getting is:
Unhandled exception at 0x00432b00 in Binary_Search_Tree.exe: 0xC0000005: Access violation reading location 0xfeef000a.
Any idea what's wrong?