I’ve been stuck on this
let aiArray: ptr aiMesh = sceneptr[].mMeshes[]
# Here aiArray is a pointer to an array(from C), how can i access the elements like aiArray[0], aiArray[1] and stuff
I tried doing the aiArray[0] thing but didn’t work, I also tried to assign it to array[0..0, aiMesh] = sceneptr[].mMeshes[] but won’t work Either.
Also how does C like pointer arrays work in nim, I am really confused about this. Please help.
>Solution :
cast[ptr UncheckedArray[aiMesh]](myPtr)[0]
Nim does not treat all pointers as indexable by default so you need to cast to an indexable ptr UncheckedArray or write the bindings as such.