I have an old Fortran77 program that calls a C++ function and passes several arrays of values to it (~ 100 individual values total). I'd like to convert the arrays to derived types, to make the code more readable and give names to the individual members of the arrays.
Is it possible to pass a derived type from Fortran to a C++ function?
How does C++ know how the structure looks like? Do I have to define the structure twice (once in Fortran and once in C++), and if yes, is there any automatic way to check that both structures are in sync?
I'm using GCC; I'd obviously have to switch the Fortran code to Fortran95 or higher.