Trying to store multi-dimensional arrays, no success


#1

I've been trying to make a table-allocator using multi-dimensional arrays (like array[8][8][8]), but without any success yet.. Is it possible at all?
if yes, how would it look like in the local and init data?

ghehe, I keep doing it.. posting questions and fixing it myself minutes later.. XD
though, not sure if it's actually working right already.. but.. it runs when I hit play now..
the next part, loading and saving a multi-dimensional table..


#2

what was your issue? (I can't think of why this is any different from 'normal'?)

might be worth posting your 'resolution' even if you discover it yourself, that way others who might face the same can learn from it.


#3

hmmm yeah well, it didn't crash when I hit play, but I haven't checked whether it actually worked and I wasn't able to store the table at all (then it did crash), so I think I'll just keep it to using a single array, divided into parts for different data.


#4

But multi dimensional arrays are nothing more than 'syntactical sugar' in C. So are single dimensional arrays really :wink:
I cannot see why they would not work, assuming your respecting dimensions/types.

I'll admit I usually use single dimensions or pointers, but this is just so I can vary dimension sizes dynamically (at runtime)... i.e. I treat as a memory block.