Re: Is there heap size limitaion?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Alexey Salmin wrote:
>> ^ This is wrong.  Should be
>>
>>  int **table1=malloc(10000000*sizeof(int**));
>>
>> The same error occurs several times.
>>
>> You also need
>>
>>  if (!table1 || !table1_aux)
>>    perror ("");
>>
>
> LOL, you've got to be kidding us :)
> "table1" is pointer to an array of (int *). That's why it has type (int **).

Sorry, thinko: sizeof(int*).  Not that it will make any difference, of course.
The change from sizeof(int) to sizeof(int *) is still needed.

Andrew.


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux