Using a C function with command line parameters

Jonathan Sternberg jonathansternberg at gmail.com
Mon Jul 4 21:29:14 PDT 2011


It's one of the applications that consumes command line arguments. So if I wanted
to implement this, a copy of the D strings (and null terminated) would have to be
made. I would also likely need to add another slot to the command line arguments
as usually the command line is null terminated for C programs.

Generally, command line arguments don't modify the parameters. But C isn't
particularly good at using const correctness.

A wrapper around glutInit would require copying the array to a C-style array,
calling the extern (C)'d function, then copying back the changes to the D side
back to a D style array. Right?


More information about the Digitalmars-d-learn mailing list