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

  • Home
  • SEARCH
  • 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 5937597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:33:51+00:00 2026-05-22T15:33:51+00:00

For the past 2 days I’ve been stuck on a violation which I can’t

  • 0

For the past 2 days I’ve been stuck on a violation which I can’t seem to get to go away.
I’ve used break points and located where the error is, but I’m just hoping one of you will know what the issue is without me having to copy+paste all my code -.-

I’m getting

First-chance exception at 0x1027cb1a (msvcr100d.dll) in Escape.exe: 0xC0000005: Access violation writing location 0xcccccccc.
Unhandled exception at 0x1027cb1a (msvcr100d.dll) in Escape.exe: 0xC0000005: Access violation writing location 0xcccccccc.

Now, a quick google search makes me think there’s something peculiar going on. All the search results talk about pointers not actually pointing anywhere (0xccccccccc is a low memory address?).

I’m yet to use pointers in my code but either way I’ll paste the function and point out the line the exception gets thrown (in bold):

void mMap::fillMap(){
    for(int i = 0; i <= 9; i++){
        for(int z = 0; z <= 19; z++){
            Tile t1;    // default Tile Type = "NULLTILE"
            myMap[i][z] = t1;
        }
    }
}

Now myMap is a 2d array of type Tile. I had this working a couple of days ago until I added some other classes and it all stopped working!

  • 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-05-22T15:33:52+00:00Added an answer on May 22, 2026 at 3:33 pm

    Either an uninitialized pointer, or a pointer stored in memory that’s been freed. I think cccccccc is the first and cdcdcdcd is the second, but it varies with compiler/library implementation.

    For your particular code, probably myMap hasn’t been allocated yet, then myMap[0][0] would result in an access attempt to 0xcccccccc.


    It can also happen that myMap is the beginning of your class, and the class pointer was uninitialized:

    class mMap
    {
         Tile myMap[10][20];
    public:
         void f() { myMap[0][0] = 0; }
    };
    
    mMap* what;
    what->f(); // what is an invalid pointer
    

    This happens because the member function is not virtual, so the compiler knows what code to run and passes the object pointer as a hidden parameter. Eventually the compiler emits a calculation like:

    this + offsetof(Whatever::myMap) + z * sizeof(myMap[0]) + i * sizeof(myMap[0][0])
    

    this, being uninitialized, is 0xcccccccc. Evidently the offsetof part is zero, and i and z are both zero the first time through your loop, so you get 0xcccccccc + 0 + 0 + 0 as the memory address.


    To debug this, use the call stack and find the function that called fillMap. Then check in that function where the pointers used for member access (->) came from.

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

Sidebar

Related Questions

I've been stuck with this for past two days. I've go java function stored
I have been trying these for past two days and getting stuck at same
Been fighting with Linux for the past few days. For whatever reason I can't
I've been the past days trying to test my first in-app purchse iphone application.
For the past few days I've been working on an online game, a 2-player
For the past few days I have been trying to play any sound over
I have been searching for the past through days, trying to figure out how
There have been several questions over the past few days about the proper use
I've been asking a question or two over the past few days of working
I've been fiddling with Redmine in the past few days and not 100% happy

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.