be careful when you drop void *, you lose type information.
what you are trying to do is wrong and false, and errors are prone and misleading. why the compiler returned a compilation error :-)
simple example
char* pChar = NULL;
unsigned char* pUnsignedChar = NULL;
char aChar = -128;
pChar = &aChar;
pUnsignedChar = static_cast<unsigned char*>(static_cast<void*>(pChar));
then, although it pUnsignedChar == pChardoes not matter, we have *pUnsignedChar == 255and *pChar == -128.
I believe this is a bad joke, so bad code.
source
share