User Profile

Collapse

Profile Sidebar

Collapse
mollwollfumble
mollwollfumble
Last Activity: Aug 28 '10, 07:22 AM
Joined: Apr 20 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • mollwollfumble
    replied to malloc for long long array?
    in C
    > The parameter to malloc has type size_t. Depending on the platform this is usually defined as one of ...

    On Visual Studio 2008 is it unsigned int?

    > If you need to use a long long for an array of floats then you are trying to allocate in excess of 16Gbytes of memory in one block.

    Very good point. At present, the program crashes at an array of length about 64 million. That's nowhere near long enough,...
    See more | Go to post

    Leave a comment:


  • mollwollfumble
    started a topic malloc for long long array?
    in C

    malloc for long long array?

    I'm a novice C programmer and am getting stuck on the insistence of malloc on using "size_t" for data array length. I want to use:
    Code:
    float *array
    long long int n
    array = malloc(n*sizeof(float))
    C insists on truncating my "long long int" to "size_t". So perhaps I have to redefine "size_t" or use an alternative to malloc. But how?
    See more | Go to post
No activity results to display
Show More
Working...