program CmodDemo;
{$LINKLIB c}
Const P : PChar = 'This is fun !';
Function strlen (P : PChar) : Longint; cdecl; external name 'strlen';
begin
WriteLn ('Length of (',p,') : ',strlen(p))
end.
|
Remark: The parameters in our declaration of the C function should match exactly the ones in the declaration in C.