I have a problem with connecting Fortran program with C++ function. My task is to call C++ function pointer from fortran, example:
// C++ function pointer
double* GetSplinePtr()
{
return sp;
}
I use iso_c_binding procedure and fortran interface. For non-pointer function i usually use this declaration:
real(kind=c_double) function Name(x,y) bind(c, name='Name')
use iso_c_binding
implicit none
real(c_double), intent(in), value :: x,y
end function Name
But what should I use for function which returns a pointer?
Thanks!
C_PTR, also a component of the moduleiso_c_binding? - Rossintent(in)andvalueare allowed at the same time? - Vladimir Fintent(inout)andintent(out)certainly conflict withvalue, but notintent(in)? - francescalusC558 An entity with the VALUE attribute shall not have the ALLOCATABLE, INTENT (INOUT), INTENT (OUT), POINTER, or VOLATILE attributes.- Vladimir F