I have an array declared as
Object array[N];
and a function as
void GetArray(void** array, size_t count)
{
*array = array;
*count = N;
}
I’m trying to call the function with this code:
size_t number;
GetArray(XXX, &number);
where is XXX what should I pass to get the array? Thank you
EDIT 1
Object *array
GetArray((void**)array, number)
EDIT 2
static Object array[N]
Though I’m not 100% convinced that I understand your intent correctly,
if
GetArrayhas to returnObject array[N]itself, how about returningObject*fromGetArray?For example:
EDIT:
As far as I see your edited question, the argument
numberforGetArrayseems to be taken as a reference(not pointer).
So, as for the array too, how about taking a reference instead of a pointer?
Then you can avoid the troublesome
void**stuff.For example: