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 8262721
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:51:02+00:00 2026-06-08T03:51:02+00:00

in other question I asked how to compile a vector with huge amount of

  • 0

in other question I asked how to compile a vector with huge amount of data because I wanted a vector with a dictionary of 107776 entries, and I couldn’t compile it.

I solved it thanks to this answer‘s code:

char const * const dict[] = {"aaron",...};

But now the problem is that when I attempt to access one entry…

cout<<dict[431104]<<endl;

…the program freezes and Windows wants to close it.

Why does it happen? How can I solve it?

Edit: sorry, it was my fault. As tbroberg and Seth Carnegie noticed in this answer, the mistake was that I thought that sizeof(dict) was the length of the array (instead of sizeof(dict)/sizeof(*dict)).
Therefore, 431104 was far out of the bounds of the array (its length is 107776).

  • 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-08T03:51:04+00:00Added an answer on June 8, 2026 at 3:51 am

    You are allocating 107776 char*s on the stack, which might be enough to cause a stack overflow on your computer. You can try allocating the char*s on the heap and use an initialiser list:

    const char** dict = new const char*[107776] {"aaron",...};
    
    // ... use dict
    
    delete[] dict;
    

    That should fix the problem (if the problem is stack size, which I think it is).

    Also, I just noticed that your index, 431104, is far out of the bounds of the array, which is of the size 107776 (I misread it as 1 million before). Are you sure your problems haven’t just been out-of-bounds indices?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Referring to the other question I asked Django using AJAX with Forms, Views ,
I know that my question will be very similar to other ones already asked
I know the question I'm going to ask is already asked for by other
This question is asked because the author is building a compiler (src -> asm)
In a prior question, I asked about using xbuild to compile a solution file,
When I asked this question I accepted the answere because it made sense and
This question was asked few other times, but I still did not manage to
I know this question has been asked countless times before, but the other threads
I've already asked the question about undefined . And because it is impossible to
For the full story, check out my other question . Basically, I had asked

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.