C Array to PB
Posted: Tue Sep 16, 2008 10:32 pm
Hey guys,
Okay, so, I'm consuming a C function which returns a pointer to a list of objects that I already have a structure for. I also know the number of objects in the list, but I don't know how to pass it to a PB variable so it can be treated as an array. For example, imagine my C function returned an array integers such as
Now, in my PB code, how would I pass that into a PB variable? Currently, I've tried this, but it doesn't work
I've also tried this
And various other ways... What is the correct way?
Thanks,
Okay, so, I'm consuming a C function which returns a pointer to a list of objects that I already have a structure for. I also know the number of objects in the list, but I don't know how to pass it to a PB variable so it can be treated as an array. For example, imagine my C function returned an array integers such as
Code: Select all
int* get_array_ptr( obj* array );
Code: Select all
Dim pba.l( get_array_size( *arr ) ) = get_array_ptr( *arr )
Code: Select all
Dim pba.l( get_array_size( *arr ) )
pba = get_array_ptr( *arr )
Thanks,