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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:41:38+00:00 2026-06-01T00:41:38+00:00

I have been scratching my head for hours trying to figure out why this

  • 0

I have been scratching my head for hours trying to figure out why this is crashing.

This is what it basically does.

I have a gui component called Table. I need 1000 tables. No more, no less. Table inherits from Widget and DynamicElement at the same time. I need to be able to pass around the address of the component (the pointer, not a copy) so I need them not to move.

The first attempt I did worked. I used a vector of Table* and each of the tables were separately allocated on the heap. This method is a bit slow and risks fragmenting the heap for nothing because I need exactly 1000.

The next solution I came up with is for the parent class to have Table m_tables[1000].

I see no reason why this should not work, but when I do it like this, it crashes. In fact, any time I seem to try to do something involving &m_tables[x] something goes wrong.

It crashes with 0xccccccccc violation whenever something tries to access the pointer obtained by doing &m_tables[i].

Is there something I am not understanding?

Here is how I create a table:

void LobbyTableManager::createTable( int tableId )
    {
        m_tables[tableId] = LobbyTable(m_fontMan,m_spriteMan,tableId);
        LobbyTable* t = &m_tables[tableId];
        t->addChairActionListeners(this);
        t->addMouseListener(this);
        t->addChairMouseListeners(this);
        t->getTable()->addMouseListener(this);
        t->rescale(1.0f);
        m_activeTables.push_back(t);
        //rescaleTables();

        m_flow->add(t);
        resizeFlow();
        updateScrollBars();
    }

I add the table to the flow layout and the second it tries to use it it crashes.

I tried using a std list which should theoretically produce the same result as my first attempt but that crashes too.

Thanks

  • 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-01T00:41:39+00:00Added an answer on June 1, 2026 at 12:41 am

    VC Debug builds initialize uninitialized variables with 0xCCCCCCCC.

    (list of special values)

    Start the program under the debugger so you can see on which line of code that happens. If it’s not your code, go up the call stack until you are inside “your” code.

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

Sidebar

Related Questions

I've been scratching my head for hours trying to figure this out. I have
i'v been scratching my head for two hours in trying to figure out whats
I have been scratching my head trying to figure out what is causing an
I've been scratching my head for a while trying to figure this out. I
I've been scratching my head over this for an hour... I have a list
I have been scratching my head for a while on this one. I dont
I have been scratching my head all morning behind this but still haven't been
I've been scratching my head with this for a couple of hours already... This
I've been scratching my head for hours on this. This reads data from a
I have been scratching my head over this for days and I still cannot

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.