Hi, I'm trying to interface some C library where the library function accepts a 
function pointer for callbacks. 
    
    
    proc libfun(fun:proc(x:pointer; n:ptr cint)) {.importc:"libfun", 
header:"mylib.h".}
    

I'm trying to write this `fun` proc in Nim, and pass it to `libfun`. How do I 
treat this `x:pointer` as an array? I want to do simple things as 
`*(x+int_number)` in C. I'm currently doing `cast[ref array[0..0,float]](x)`, 
and removing bounds checking. But is there a better way to do this in Nim? 

Reply via email to