Passing a structured data type from Fortran to C++ [duplicate]
问题 This question already has an answer here : Fortran derived types containing pointers to be accessible from C (1 answer) Closed 2 years ago . I have a structured type in Fortran that contains lots of data including pointers (real*8 pointer data type). I am developing a C++ API for some Fortran routine. I need the contents of the structure to persist between calls to the Fortran routine. I was thinking about getting the address of the structure using loc and pass the address to the C++ side.