2009-03-11から1日間の記事一覧
reinterpret_cast演算子は単なる型変更のキャスト。static_castでは型変換の処理が行われるが、こちらはただ指すものが変わるだけ。無理矢理、その解釈の仕方を変えるという感じかな。 void func() { char c = 'a'; int address = reinterpret_cast<int>(&c); } </int>…
reinterpret_cast演算子は単なる型変更のキャスト。static_castでは型変換の処理が行われるが、こちらはただ指すものが変わるだけ。無理矢理、その解釈の仕方を変えるという感じかな。 void func() { char c = 'a'; int address = reinterpret_cast<int>(&c); } </int>…