[fpc-pascal] Build in a C compiler
Maciej Izak
hnb.code at gmail.com
Wed Apr 20 09:25:26 CEST 2016
2016-04-20 8:58 GMT+02:00 leledumbo <leledumbo_cool at yahoo.co.id>:
> At syntax level, there's no Pascal equivalent
> of C's comma (sequence) operator. Argument evaluation in C is strictly
> right
> to left, in Pascal it's up to the compiler. A silly but valid C statement:
>
> printf("%d%d%d\n",i++,++i,++i,i++);
>
> would be hard to convert to Pascal automatically without blowing out the
> compiler.
>
C's comma (sequence) operator is possible to use in Pascal:
function printf(fmt: PAnsiChar): Integer; cdecl; varargs; external
'msvcrt.dll' name 'printf';
begin
printf('%d%d%d'#10,1,2,3,4);
end.
--
Best regards,
Maciej Izak
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20160420/b6fdc097/attachment.html>
More information about the fpc-pascal
mailing list