Brett wrote:
> Personally, even in C, if I had a complex array like that 
> to pass
> around, I'd go for a  more object-oriented approach and 
> wrap it with a
> struct, so you could store lengths of dimensions, etc.

In C I'd create a suitable array in main() or wherever by 
allocating some memory, and pass the function a pointer to 
the start of the memory area, along with array dimensions. 
The function can then modify the array and return a value 
indicating success or failure (or void if it's bound to 
succeed).

The advantages are that it involves no array copying 
(important with large arrays, though not with 10 x 10) and 
it's not difficult to see what's going on.

David

Reply via email to