Emil Jerabek wrote:
Ah, sorry. I shouldn't have said it is predefined, it is in the gpc unit. So "import gpc;" will do the trick.
I wrote:
In C you have to use the linker name, as revealed in gpc.pas:
CParamCount: Integer; attribute (name = '_p_CParamCount'); external; CParameters: PCStrings; attribute (name = '_p_CParameters'); external;
i.e.:
int _p_CParamCount; const char **_p_CParameters;
To avoid confusion, my suggestion was when you want to access the variables directly from C, Emil's when you want to pass them from Pascal. In fact, the latter is probably better, as it avoids relying on the linker name.
Frank