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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:50:21+00:00 2026-06-17T16:50:21+00:00

I seem to be getting a really weird error. Basically, I have a class

  • 0

I seem to be getting a really weird error. Basically, I have a class A that is meant to manage a disk cache for pixel data. From the main program, I create an object of A using:

A* obj = new A(...);

Then, I call a method to read a pixel from the disk:

Pixel pix = obj->read(...);

However, when I try to use the “this” pointer to access private member variables of A from within the read() method, I get an access violation error because the “this” pointer is uninitialized (set to 0xCCCCCCCC by MSVC 2012). However, I checked the value of the “obj” pointer returned by the constructor, and it seems to be a valid address.

My guess is that somehow the constructor failed, but why, then, would it have returned a pointer to the object? Alternatively, if the constructor didn’t fail, why is the “this” pointer uninitialized from within the class?

  • 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-17T16:50:22+00:00Added an answer on June 17, 2026 at 4:50 pm

    In Visual Studio C++, what are the memory allocation representations?:

    • 0xCCCCCCCC : Used by Microsoft’s C++ debugging runtime library to mark uninitialised stack memory

    At the moment you do obj->, your obj is not initialized. The two lines of code in the question are not your real code, or there is something important taking place in between.

    Plain stepping through using debugger will give you an answer to the question.

    One of the possible causes is that you have 2+ obj local variables in your function.

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

Sidebar

Related Questions

I'm getting a syntax error that I don't seem to find an answer to
I seem to be getting an error I can't really understand. Hopefully this doesn't
I seem to be getting the above error when trying to make a callable
I'm getting errors and warnings that seem to indicate that 4th edition examples are
I seem to have a problem with getting MVC to fill in my custom
I cannot seem to figure out I am getting the following error in IE
I'm getting the following error message and I can't seem to figure out the
This may seem like a simple question but i am getting an error when
Okay...I'm really getting a bit frustrated with this. I know that this post will
I'm getting an error I really don't understand when reading or writing files using

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.