Jammer
04-04-2002, 11:42 PM
Alright, I'm righting a Binary Tree class. I have it all done, but I have errors on my traversals. All of these are traversal which accept a node pointer and a void (*function) (itemType &target) function as a paramater. I get the follow errors:
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function '__thiscall searchTree<int>::searchTree<int>(class searchTree<int> &)'
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myPostOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type
while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myPreOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target while compiling class-template member function 'void __thiscall searchTree<int>::operator =(class searchTree<int> &)'
As you can see, they are all virtually the same. The errors are from compiling bstRun.cpp (http://mywebpages.comcast.net/jammer211/bstRun.cpp). This runs with bst.h (http://mywebpages.comcast.net/jammer211/bst.h) and bst.cpp (http://mywebpages.comcast.net/jammer211/bst.cpp).
Thanks, I'd appreciate any help you could offer.
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function '__thiscall searchTree<int>::searchTree<int>(class searchTree<int> &)'
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myPostOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type
while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myPreOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target type while compiling class-template member function 'void __thiscall searchTree<int>::printTree(int)'
error C2664: 'myInOrder' : cannot convert parameter 2 from 'void (int &)' to 'void (__cdecl *)(int &)' None of the functions with this name in scope match the target while compiling class-template member function 'void __thiscall searchTree<int>::operator =(class searchTree<int> &)'
As you can see, they are all virtually the same. The errors are from compiling bstRun.cpp (http://mywebpages.comcast.net/jammer211/bstRun.cpp). This runs with bst.h (http://mywebpages.comcast.net/jammer211/bst.h) and bst.cpp (http://mywebpages.comcast.net/jammer211/bst.cpp).
Thanks, I'd appreciate any help you could offer.