I've got a function Quit that is receiving a void** and I need to pass it to a new function who's receiving a DataStructure*.
The problem is that the data in ds is replaced with garbage. What can I do ?
void Quit(void** DS){
DataStructure* ds = (DataStructure*) *DS;
return ds->Quit(); //'void*' is not a pointer to object type
}
when the definition of the second Quit() is:
void DataStructure::Quit();
and the call in main is done as follow:
DataStructure *data;
Quit((void**) &ds);
We get the same result if we cast as follow:
DataStructure* ds = reinterpret_cast<DataStructure*>(*DS);