On 2016-08-03 10:27, RomanZ wrote:
version(RefOut)
    extern(C) void fun(out int input, ref in output);
else
    extern(C) void fun( /*[out]*/ int* input, const(float)* output);

version = RefOut;
void main() {
    int input;
    float output;
    fun( input, output ); // work fine; is it correct binding? or where
the trouble?
}

It should work. It depends on how close you would like the D code to be to the C code. For example, the C code requires to pass pointers where in the D code this will handled automatically.

Note also that "out" parameters are automatically reset to there .init value when passed to a function.

--
/Jacob Carlborg

Reply via email to