Doc Comments /
Interface To C
Difference (last change) (no other diffs, normal page display)
Changed: 1c1,25
Describe the new page here. |
= Interfacing to C = == Messages = Add your comments here... === Calling D functions from C === There is a short section on calling D functions from C, but as it has no subheading it is not obvious that the subject has changed from D calling to C. === extern (C) int foo; === extern (C) int foo; creates a new foo variable in D, but is just a definition of an external variable in C. the usual workaround is to put all data definitions in a separate module, that is import from the function defs (but the resulting data object code is never linked in) == Links = * Corresponding page in the D Specification ** ![]() ** ![]() |
Interfacing to C
Messages
Add your comments here...
Calling D functions from C
There is a short section on calling D functions from C, but as it has no subheading it is not obvious that the subject has changed from D calling to C.
extern (C) int foo;
extern (C) int foo; creates a new foo variable in D, but is just a definition of an external variable in C.
the usual workaround is to put all data definitions in a separate module, that is import from the function defs (but the resulting data object code is never linked in)
Links