by "Victor Bazarov" <v.Abazarov@[EMAIL PROTECTED]
>
May 5, 2008 at 04:42 PM
pleatofthepants wrote:
> I have a Binary Search Tree and a function called inOrder
>
> void inOrder (TreeNode<T>*, ostream& out)
I take it that your function is stand-alone, right?
> which is being called like this: a.inOrder(cout);
In order to be callable with the '.' syntax, the function needs to be
a member.
> But it will not work because the parameters are not the same. The
> function call has to be the same but what can I change in the function
> to allow this?
You need to put the function in the 'TreeNode' class template and
refactor it so that it uses 'this' instead of the first argument.
V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask