가능한 중복 :
Should I use static_cast or reinterpret_cast when casting a void* to whateverstatic_cast와 reinterpret_cast의 효과가 같을 때 사용할 수있는 것은?
종종는 Win32는 다른 하나 개의 불투명 한 유형에서 캐스팅하는 데 필요한 프로그래밍 특히에서. 예를 들어 :
HFONT font = cast_here<HFONT>(::GetStockObject(SYSTEM_FONT));
static_cast와 reinterpret_cast 모두 여기에 적용하고 HFONT 특별히 GetStockObject (에 의해 반환 HFONT 및 HGDIOBJ을 정의 도입 구조체 더미에 대한 포인터이기 때문에 정확히 같은 효과) 무효 * 포인터가 있습니다.
static_cast 또는 reinterpret_cast 중 어느 것이 더 좋습니까?
Dupe : http://stackoverflow.com/questions/310451 –