[fpc-pascal] Two-dimensional dynamic arrays in C libraries

Michael Van Canneyt michael at freepascal.org
Fri Sep 2 17:59:26 CEST 2005



On Fri, 15 Jul 2005, Silvio a Beccara wrote:

> Hi everybody,
> 
> I need to pass two- or three-dimensional dynamic arrays to C libraries from 
> FPC. I know this is feasible with one-dimensional arrays, by using a pointer 
> to the array: for instance 
> 
> ---code
> type
> PDouble = ^Double;
> 
> function get_array(a, b: PDouble; size: integer; value: double): 
> integer; cdecl; external 'mylib.dll';
> 
> qq := get_array(PDouble(mat1),PDouble(mat2),kk,3.14);
> 
> ---end code
> 
> but it doesn't seem to work with more dimensions. How could I do?

You'll have to be more specific. Do you know the C interface, or do
you have to make the C interface ?

Michael.



More information about the fpc-pascal mailing list