[fpc-pascal] memory layout of arrays

Vinzent Hoefler JeLlyFish.software at gmx.net
Thu Sep 14 11:47:40 CEST 2006

On Thursday 14 September 2006 09:20, Jerry wrote:

> however. Beware of 2D arrays in C because there seems to be no
> requirement in C that all of the data be allocated in contiguous
> memory;

Most probably yes. This applies to all mutidimensional arrays in C. The 
reason is simple, arrays and pointers are handled quite the same way, 
so there's an automatic dereferencing for each array subscript...

Described in Pascalish terms it would be a N-dimensional array of 
pointers to an (N-1)-dimensional array of pointers to an 
(N-2)-dimensional array ...


More information about the fpc-pascal mailing list