I understand the use of void pointer for malloc implementation.
void* malloc ( size_t size );
Can anyone suggest other reasons or provide
Next to interfacing with C, I find myself only using void pointers when I need to debug / trace some code and like to know the address of a certain pointer.
SomeClass * myInstance;
// ...
std::clog << std::hex << static_cast< void* >(myInstance) << std::endl;
Will print something like
0x42A8C410
And, in my opinion, nicely documents what I'm trying to do (know the pointer address, not anything about the instance)