Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9220457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:21:11+00:00 2026-06-18T03:21:11+00:00

So i wrote a driver for class that uses a menu to test out

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T03:21:12+00:00Added an answer on June 18, 2026 at 3:21 am

    I figured this out. I forgot that the stack has only a limited space on it, and i needed to use the “new” keyword to make sure all this was going on the heap

    while (numChoice!=0){
            switch(numChoice){
            case 1: myList= new MyHashContainer(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
            case 2: myList= new hash2(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
            case 3: myList= new chainingHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
            case 4: myList= new quadraticHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
            case 5: myList= new DoubleHash(myStudentList.getStudentList(),myStudentList.getStudentList().size(),p);break;
    
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class in managed C++ that has all its member variables initialized
I have a class library that I have written in C#.net. I want to
I have been trying to figure out the best practices to write test-friendly code,
I understand that I must have public read and write properties on my class
I have written a windows service that uses the openpop mail client and retreives
I am currently trying to write data to a HID driver that i have
I have problem with JDBC application that uses MONEY data type. When I insert
I am trying to write an Setup Project/Installer for a class library driver that
I've developped a DLL for a driver in C. I wrote a test program
My main problem is I have a class, Database.java, that access and updates the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.