So i wrote a driver for class that uses a menu to test out different hashing techniques. What i have is an abstract class "BaseHash" with all virtual functions and 5 different child classes that hash in different ways. When i do this:
while (numChoice!=0){
switch(numChoice){
case 1: myList= &MyHashContainer(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
case 2: myList= &hash2(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
case 3: myList= &chainingHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
case 4: myList= &quadraticHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
case 5: myList= &DoubleHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
}
}
I get a stack overflow error the moment main is called. The debugger doesnt even let me get one step out before throwing the error.
If it matters myList looks like this
BaseHash *myList;
If i comment out the code starting with while, it does not throw this error. I dont even know where to begin with why this might happen.