This is a bit outdated, but I disagree with the consensus. You cannot use static_cast to cast from any type to void* , you only do this with reinterpret_cast . static_cast reserved for types that are supposedly compatible, some compile-time checking is done (i.e. derived classes, numeric types between them). A.
With this MSDN link:
dynamic_cast Used for conversion of polymorphic types. static_cast Used for conversion of nonpolymorphic types. const_cast Used to remove the const, volatile, and __unaligned attributes. reinterpret_cast Used for simple reinterpretation of bits.
source share