tags:

views:

58

answers:

1
+1  Q: 

Expected ctor

I am writing a delete member function for a Binary Search Tree. I have already written a boolean search function to return true/false based on whether it is in the BST. I have retooled it as a new function to return a Node* so that my delete function can call it and get a pointer directly to the correct Node.

Right now, I am getting a compile error on this line of code:

//"Expected constructor, destructor, or type conversion before '*' token
Node* BinarySearchTree::Search(int val);

struct Node is private to BinarySearchTree. I tried adding them as friends to each other, but that did not resolve the problem. Can anyone shed some light?

+4  A: 

You should qualify Node:

BinarySearchTree::Node* BinarySearchTree::Search(int val);
Pavel Minaev
That solved it. I did not know that. Thanks!
Hooked