To pass a complex or double complex argument to a C procedure, declare the corresponding argument in the C procedure as either of the two following structures, depending on whether the actual argument is complex or double complex:
struct { float real, imag; } *complex;
struct { double real, imag; } *dcomplex;
Example below shows Fortran code for passing a complex type called compl and the corresponding C procedure.
Fortran Code |
Corresponding C Procedure |