hello...I'm designing an interface that each module of my app should follow. It has a funcion for initialization, one for finalization ecc. Their prototypes are like that:
The problem is that the Init function of each module should use ptr not as a void*, but as a type different from module to module. Each implementation of the Init function in the modules use ptr as pointer to a proprietary type. So I tried doing so:Code:int Init(void* ptr); void Destroy(); //ecc.
but VC++ 2005 gives me an error sayng that ptr is a pointer to void instead of a struct.Code:int Init(void* ptr) { (strMyStruct*) ptr; ptr->a = 10; }
So is there a way to cast ptr only one time for all the scope of the function?