to pass char*, pass @yourString[1]
to pass array, say, int*, pass @yourArray[1]
to receive char*, pass char*, receive PChar, then loop through it to find 0-char which indicates end of string, then copy it to Pascal string
to receive int[], pass int[], pass its length, receive a: PInteger and length: Integer, then copy memory to array of Integer
it's that simple
pascal strings and dynamic arrays are released as soon as they are not in scope. If you need to store pascal string in C++ part of program, then make a copy of it; same goes to dynamic arrays
you can share record <-> struct as well if they are identical and packed. In FPC use packed keyword, in GCC use
struct __attribute__ ((__packed__)) my_packed_struct
{
char c;
...
yesss....
https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.htmlit's that easy. I spent some time learning this stuff so it just comes naturally to me
read some article
here's some article:
http://rvelthuis.de/articles/articles-convert.html not sure if it will be helpful