So if your converting from Void* to Type* or from Type* to Void* should you use:
void func(void *p)
{
Params *params = static_cast<Params*>(p);
}
or
void func(void *p)
{
Params *params = reinterpret_cast<Params*>(p);
}
To me static_cast seems the more correct but I've seen both used for the same purpose. Also, does the direction of the conversion matter. i.e. should I still use static_cast for:
_beginthread(func,0,static_cast<void*>(params)
I have read the other questions on C++ style casting but I'm still not sure what the correct way is for this scenario (I think it is static_cast)