Using a C function with command line parameters

Jonathan Sternberg jonathansternberg at gmail.com
Mon Jul 4 07:31:58 PDT 2011


glut has the function:

    void glutInit( int* pargc, char** argv );

In order to use it. Since D has an ABI compatible with C, I should be able to
write a D file with extern (C) on the glut functions. How would I wrap this
function to be used with D arrays? Such as:

int main(string[] args)
{
    glutInit( /* I don't know what to do here */ );
    return 0;
}

Thanks.


More information about the Digitalmars-d-learn mailing list