On Saturday, February 22, 2014 12:36:06 AM UTC+1, John Myles White wrote:
>
> I'm guessing that you need to change 
>
> ccall(:sscanf, Int32, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Int32}, Ptr{Int32}, 
> Ptr{Uint8}), 
>  "12:30 AM", "%d:%d %s", hour, minutes, ampm) 
>
> to 
>
> ccall(:sscanf, Int32, (Ptr{Uint8}, Ptr{Uint8}, Ptr{Int32}, Ptr{Int32}, 
> Ptr{Uint8}), 
>  "12:30 AM", "%d:%d %s", &hour, &minutes, &ampm) 
>
> But am not totally sure. 
>
>
No, that's not the case. I defined hour and minutes as arrays, so that they 
can be converted to Ptr variables by ccall; strings like ampm are also 
converted to Ptr without problems. I should have added the "&" if hour and 
minutes were scalar variables, but their values would not have been changed 
by the function. See 
http://docs.julialang.org/en/latest/manual/calling-c-and-fortran-code/

Helios

Reply via email to