PL_get_pointer returns FALSE

I’m developing a prolog program that interacts with C code. I’m using the function int PL_get_pointer to pass pointers from prolog to C. However, the functions returns 0 (FALSE). In general, what could be the cause of the failure of this function?

Typically that the argument is not a pointer :slight_smile: You can only use this together with PL_put_pointer() or PL_unify_pointer(). Still, one should be really careful. It is very easy to mess up and crash. The blob interface is a little harder to use and in general a bit more costly, but it allows safe interaction with C data.

1 Like