Having a small problem with a function I'm trying to run.
Employees *ptr = tree.empSearch(srchNum);
srchNum is an int initialized to equal 0. The function empSearch is supposed to accept an employee ID number, search my binary tree, and return the employees name as well as the corresponding ID number (which would be the same as the one entered for srchNum).
I know this works, as I've seen it execute in an example program, and I'm trying to follow the same logic, but for some reason Employees *ptr = tree.empSearch(srchNum); keeps throwing me an error for srchNum, saying it couldn't be converted from 'int' to my 'Employees' class. I've tried to look up how to convert it, but I haven't found anything.
Okay, I understand that empSearch() takes an Employees object as an arguement, and so obviously I can't use an int as the arguement. I know that, but I have seen it done in a working program, which I have and I'm trying to follow the logic to make my own work.
I've tried instantiating an object of my BSTtemplate class to accept an int, but I realized that wouldn't work, because an int can't be used to instantiate an Employees class object.
So obviously this isn't working the way I've been trying to do it. I'm going to step back and try a different method. I can get the information into the tree, it's doing this search that is the problem.