[fpc-pascal] memory layout of arrays
Marc Santhoff
M.Santhoff at t-online.de
Thu Sep 14 12:01:02 CEST 2006
Am Donnerstag, den 14.09.2006, 11:16 +0200 schrieb Jonas Maebe:
> On 14 Sep 2006, at 11:00, Marc Santhoff wrote:
>
> > I need to hand over arrays to a C library and have no influence on how
> > access is done internally (still und investigation). Currently the
> > C lib
> > reads garbage from my array ...
>
> That means that the type you use in Pascal is probably different from
> the type used in C.
You got me, I've looked 20 times and did not notice using integer for my
array, now it is longint and anything works fine!
Btw., is there any function for asking for the internal type of a
variable? Something like "typeof(anyvar)" spitting out a type code or
string saying what memory type this is?
Okay, for integers sizeof() would at least tell the number of bytes ...
but nothing about alignment and no idea about float values.
Thank you all,
Marc
More information about the fpc-pascal
mailing list