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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T19:26:28+00:00 2026-05-25T19:26:28+00:00

Okay, I have a struct, TextBlock , that simulates moving blocks of text around

  • 0

Okay, I have a struct, TextBlock, that simulates moving blocks of text around the screen. Here’s the header:

struct TextBlock
{
    RECT textArea;
    RECT rectArea;
    double whatBlock;
    double x;
    double y;
    double angle;
    double speed;
    double width;
    double height;
    char *word;
    bool stuck;
};

When it’s like this, everything works perfectly fine. The problem comes when I add another member that I need. The way it works is that I have two arrays of TextBlocks. The first is for moving ones, the second is for ones that don’t move, signifying where the moving ones need to go. The words are all randomized from a sentence to a jumble, so this data member will be set (commented out) to the index of which static block belongs to the moving one so I know when it’s in the right place.
int whatBlock;
After creating this, I go through all of the created objects and set
tb[i][j].whatBlock = 0; //same area as other data members being set, moving text
stb[i][j].whatBlock = 0; //static text block

When I try to run this, without doing anything else to the data member, it comes up with an error:

The instruction at [address] referenced memory at [different address]. The memory could not be "written".

Note that if I don’t try to modify it, and just create the data member, it works.

At this point of almost being done and having tons of these kinds of problems, I’m getting a bit fed up with this program >.> Any help at all on this would be greatly appreciated.

EDIT: This issue is now fixed. I replied to the accepted answer with the explanation, but it poses another problem, even if it doesn’t affect this program.

  • 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-25T19:26:29+00:00Added an answer on May 25, 2026 at 7:26 pm

    Without you posting more code, I can only tell that you likely have a memory corruption bug in your program – i.e. you are reading or writing beyond the end of allocated memory.

    If you post more code, I’ll edit this answer accordingly.

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

Sidebar

Related Questions

Okay I have a large CRUD app that uses tabs with Forms embedded in
Okay, I have a page on a Drupal install that has multiple divs. I
Okay... We have a contact books in Exchange that gets exported into an XML
Okay, I have a main source called main.c , a header file called test.h
Okay I have this RewriteRule which is supposed to redirect any request for the
Okay I have a series of objects based on a base class which are
okay i have found the way to run a video in a image.... the
Okay I have updated my code quite a bit. I am getting a new
Okay I have updated my code a little, but I am still not exactly
Okay i have two models: posts and comments. as you can think comments has

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.