>>2 ignore counter
Because you want us to guess at the problem without knowing what 'error' you're talking about (or even whether it's compile time or run time) and you don't want us to know that you did int Counter = x; at one point, which is the source of all your problems? Yeah? Well fuck you.
Name:
Anonymous2010-10-13 23:31
>>2
You need to delete in the opposite order that you allocated. for (int i = 600; i > 0; i--)
free(x[i-1]);
free(matrix);
Name:
Anonymous2010-10-13 23:31
>>3
HEAP[aids.exe]: Invalid address specified to RtlFreeHeap( 00470000, 00473E58 )
Windows has triggered a breakpoint in aids.exe.
This may be due to a corruption of the heap, which indicates a bug in aids.exe or any of the DLLs it has loaded.
@ free(x[i]); //i==0 triggers it
run time
and no, Counter has nothing to do with it. I just wrote down the wrong name when posting.
Name:
Anonymous2010-10-13 23:37
>>4 [code]
First-chance exception at 0x7762dc9b in aids.exe: 0xC0000374: A heap has been corrupted.
Unhandled exception at 0x7762dc9b in aids.exe: 0xC0000374: A heap has been corrupted.
[code]
that worked till it got to about x[80-70] range then it error'd again
Here is a ``better'' way to construct a dynamic n-by-m array. Assume n and m are of type size_t. Handling of arithmetic wrap-around (if necessary) and malloc failure are omitted for brevity.
type **x = malloc(n * sizeof *x);
x[0] = malloc(n * m * sizeof *x[0]);
for (size_t i = 1; i < n; i++)
x[i] = x[i-1] + m;
>>32
youve just been HURT FEELINGS AND BUTT RANGED go drink ur moms bredt milk u fart commander i bet u hav a fetish FOR MEN LMAO ur just so made all the time its 2 easy 23 own u "i like to drnikj sperm from my spermbottle while waring my sperm necklace" - u