// example.cpp
function alloc(int **p) {
return *p = new int[10];
}
// example.js
var ptrPtr = ref.alloc(ref.refType(ref.types.int));
// pass the `ptrPtr ` to function `alloc`, use `node-ffi`
// ...
// now, `ptrPtr.deref()` should point to an array, but it points to `*p[0]`,
// how to access `*p[1]`, `*p[2]`, ... ?
console.log(ptrPtr.deref());
I think the codes below is clear