最終更新:2011-09-28 (水) 06:39:52 (4593d)  

型変換?
型キャスト
Top / 型キャスト

C言語

int a;
float f:
f = (float)a;

C++

  • static_cast - 一般的な形のキャスト
  • dynamic_cast - 安全にダウンキャストを行うためのキャスト
  • const_cast? - const や volatile を無効化するために使う
  • reinterpret_cast - 根本的に異なる型同士のキャストに使う

キャストの種類

参考