Proper way of casting pointer types
问题 Considering the following code (and the fact that VirtualAlloc() returns a void*): BYTE* pbNext = reinterpret_cast<BYTE*>( VirtualAlloc(NULL, cbAlloc, MEM_COMMIT, PAGE_READWRITE)); why is reinterpret_cast chosen instead of static_cast ? I used to think that reinterpret_cast is OK for e.g. casting pointers to and from integer types (like e.g. DWORD_PTR ), but to cast from a void* to a BYTE* , isn't static_cast OK? Are there any (subtle?) differences in this particular case, or are they just