Intel® Fortran Compiler 17.0 Developer Guide and Reference
For a derived type to be interoperable with C, you must specify the BIND attribute, as shown in the following:
Specifying BIND Example |
---|
|
Additionally, as shown in the examples that follow, each component must have an interoperable type and interoperable type parameters, must not be a pointer, and must not be allocatable. This allows Fortran and C types to correspond.
Interoperable Type and Type Parameter Example |
---|
typedef struct { int m, n; float r; } MyCtype |
The above is interoperable with the following: |
|
The following restrictions apply to a derived type specified with the BIND attribute:
It cannot have the SEQUENCE attribute
It cannot be an extended type
It cannot have type-bound procedures