Skip to content
Prev 23210 / 63424 Next

capturing value of C or Fortran function

Well, fortran subroutines don't really have return values (versus 
fortran functions, which do - as far as I know that's the only 
difference between fortran subroutines and functions).

There is also a somewhat sticky matter, of C routines that returns
fairly complex types, like pointers, strings... and likewise, fortran
functions can return rather complex things, like matrices, etc.
It is going to be difficult to do a one-size-fit-all solution.

So all you are trying to cater for, is a rather small subset of 
C/fortran functions which returns a single int or a single double?

(anything to do with arrays you'll need to "smuggle" the array size
out the old-fashion way via argument pointers).
Harris A. Jaffee wrote: