I suppose you have to revert all the steps that it took to call the function with the original data.
For example:
Code:
#include <cstdio>
void foo(int count, void** arr)
{
void* vp = *arr; //dereference to obtain void pointer
int* p = (int*)vp; //and cast it back to int pointer
for (int i = 0; i != count; ++i) {
printf("%d ", p[i]);
}
}
int main()
{
int arr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
void* p = (void*)arr; //cast to void*
foo(10, &p); //and pass its address
}
But why would you mess with the void pointers if you know they point to an int array?