[fpc-pascal] Array as result in function.

Vojtěch Čihák vojtech.cihak at atlas.cz
Sat Jan 21 14:30:14 CET 2017

that's why portaudio.pp declares types like this:
PaStream = Pointer;
PPaStream = ^PaStream;
PPPaStream = ^PPaStream;
> Od: Sven Barth <pascaldragon at googlemail.com>
> Komu: fpc-pascal at lists.freepascal.org
> Datum: 21.01.2017 12:29
> Předmět: Re: [fpc-pascal] Array as result in function.

 If the C code however is the one allocating the array (in which case the
 type is usually a pointer to a pointer, like "float**" or "^pcfloat" in
 Pascal) then you *must not* use a Pascal array, but instead simply pass
 in a "pcfloat" variable like this:
 I hope this clears up a few points for mixing C and Pascal arrays.
 fpc-pascal maillist  -  fpc-pascal at lists.freepascal.org
 http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal <http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20170121/94cf1aba/attachment.html>

More information about the fpc-pascal mailing list