An array is really just a pointer to some contiguous memory. A void* is a generic pointer, it can point to any type. You just need to cast it back to something useful. The following should work.
int* arrayPointer = (int*)voidPointerVariable;
Then you can use arrayPointer like you would any array.
An array is really just a pointer to some contiguous memory. A void* is a generic pointer, it can point to any type. You just need to cast it back to something useful. The following should work.
int* arrayPointer = (int*)voidPointerVariable;
Then you can use arrayPointer like you would any array.
arrayPointer[0], arrayPointer[1], etc.
Perfect - as you can tell, I am not knowledgeable with pointers - thank you very much.
Posts
int* arrayPointer = (int*)voidPointerVariable;
Then you can use arrayPointer like you would any array.
arrayPointer[0], arrayPointer[1], etc.
Perfect - as you can tell, I am not knowledgeable with pointers - thank you very much.