2010/9/23 Graeme Geldenhuys <graemeg.li...@gmail.com>: > Out of interest. Do you know if dynamic array elements are in sequence > (storage area in memory) too - like static arrays? So could I do the > same as above, but instead of using a static array, use a dynamic > array, and pass the address of the first element to the C API?
AFAIK yes as long as you don't break (it's possible using some wild casting) the ref counting mechanism and handle the zero length case. var V1: array [L..H] of T; V2: array of T; magic_c_function(@V1[L]); if Length(V2) <> 0 then magic_c_function(@V2[0]) else magic_c_function(nil); -- bflm freepascal-bits.blogspot.com _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal