You don't have an & on c – even if you did, the & syntax doesn't let you write values, so that still wouldn't work. You can try setting c = Array(Float64) and then pulling the value written to it out as c[].
On Wed, Feb 11, 2015 at 12:45 PM, DP <[email protected]> wrote: > Trying to work with subroutines (I am a MATLAB person without fortran and > julia knowledge) > > File Name : fsbrtn.f90 > > SUBROUTINE MULTIPLY(A,B,C) > DOUBLE PRECISION A,B,C > C = A*B > RETURN > END > > gfortran -shared -O2 fsbrtn.f90 -fPIC -o fsbrtn.so > > a = 100.0 > b = 10.0 > c = 1.0 > ppmm = ccall((:multiply_, "/home/juser/ManUTD/fortran_try/fsbrtn"), > Void,(Ptr{Float64},Ptr{Float64},Ptr{Float64}),&a,&b,c) > println(c) > > Output > 1.0 > > Where am I going wrong? > > > ergerg >
