Bastiaan Veelo wrote:
So I figured out that the first element in the struct is an integer containing the length-1 of the array, but what it should look like for the rest I do not know yet. Do you have an idea?
Just to explain this mystery, for (BP style) open array parameters, GPC internally passes a hidden parameter containing the high limit of the array. (BTW, BP open arrays are always shifted to a low limit of zero, but this array is 0-based anyway already.) So this value contains the number of parameters (whereas argc in C contains the number including the 0th parameter, so is one higher). That your struct works is conincidence. It probably doesn't work on all platforms and may break with other GPC versions. So if anything, use a separate parameter in C. However, the type would have to be a Pascal Integer (not a CInteger) which isn't readily available in C.
However, I'd second what Markus wrote, to avoid relying on this passing mechanism at all, and pass only things to C that have a direct counter-part in C. Unfortunately, all higher-level dynamic array mechanisms (open array, conformant arrays, schemata) don't, so this often means a formally-unbounded plain array ...
Frank