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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:40:26+00:00 2026-05-30T12:40:26+00:00

I am trying to setup a C style multidimensional array. It is a 301

  • 0

I am trying to setup a C style multidimensional array. It is a 301 by 16 array of float values. I am using the following code :

float ** animationArray;

animationArray = (float **)calloc(16, sizeof(float*));
    for (int i=0; i<301; i++) {
        animationArray[i] = (float*)calloc(301, sizeof(float));
    }

    int i;

    for (i=0; i<301;i++) {

    NSArray * animationEntry = [Animations objectAtIndex:i];

    animationArray[i][0] = [[animationEntry objectAtIndex:0]doubleValue];
    animationArray[i][4] = [[animationEntry objectAtIndex:1]doubleValue];
    animationArray[i][8] = [[animationEntry objectAtIndex:2]doubleValue];
    animationArray[i][12] = [[animationEntry objectAtIndex:3]doubleValue];
    animationArray[i][1] = [[animationEntry objectAtIndex:4]doubleValue];
    animationArray[i][5] = [[animationEntry objectAtIndex:5]doubleValue];
    animationArray[i][9] = [[animationEntry objectAtIndex:6]doubleValue];
    animationArray[i][13] = [[animationEntry objectAtIndex:7]doubleValue];
    animationArray[i][2] = [[animationEntry objectAtIndex:8]doubleValue];
    animationArray[i][6] = [[animationEntry objectAtIndex:9]doubleValue];
    animationArray[i][10] = [[animationEntry objectAtIndex:10]doubleValue];
    animationArray[i][14] = [[animationEntry objectAtIndex:11]doubleValue];
    animationArray[i][3] = [[animationEntry objectAtIndex:12]doubleValue];
    animationArray[i][7] = [[animationEntry objectAtIndex:13]doubleValue];
    animationArray[i][11] = [[animationEntry objectAtIndex:14]doubleValue];
    animationArray[i][15] = [[animationEntry objectAtIndex:15]doubleValue];

    }

}

However this code causes a crash with the error “incorrect checksum for freed object – object was probably modified after being freed.”

Could anyone possibly spot what is wrong ?

  • 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-30T12:40:27+00:00Added an answer on May 30, 2026 at 12:40 pm

    You switched 16 and 301 in your for loop in regards to your allocation call.

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

Sidebar

Related Questions

Im trying to setup my asp.net mvc page like the following image: The header
I'm trying to setup an MVVM style application, and I think I'm getting myself
I'm trying to setup a CSS style to highlight a table cell in a
I'm trying to display an array of dictionaries variable in the table Cell Style
I have a simple gallery style link setup using image swap on hover that
I am trying to setup an NSTableView programmatically (I really need to avoid using
I have the following bit of code. I'm trying to dynamically add drop-down options
I have this basic scenario setup where I am trying to float divs inside
I'm trying to use the mini-profiler with old-style EF code - database-first. So far:
I'm trying to set up an accordian style list of tabs where I can

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.