is this syntax
Ref{Float64}(0.0)the generic way to declare an output argument before calling a C function?
Yes. If you need to use the content(jd) of this Ref variable(jd_ref), it’s necessary to init it in this way(i.e. bind Ref(jd) to a variable name(jd_ref)). If not, you could use a tmp variable like:
jd = 0
ccall((:MtkDateTimeToJulian, mtklib), Cint, (Cstring, Ptr{Float64}), dt, Ref(jd))
# this time, the content of the tmp variable `Ref(jd)` will be populated by the C function,
# but there is no way to get that content on the Julia side.
# jd is still 0.
BTW, you might be interested in CBinding.jl and Clang.jl which are two packages in the Julia ecosystem that can make life easier when calling C libs in Julia.