掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
charとunsigned charとdeleteについて (ID:68258)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
ISO/IEC 14882:1998 5.3.5 Delete (3) In the second alternative (delete array) if the dynamic type of the object to be deleted differs from its static type, the behavior is undefined. とあるっす reinterpret_cast 一発のほうが適切でっしゃろ、この場合 5.2.10 reinterpret_cast (7) A pointer to an object can be explicitly converted to a pointer to an object of different type. 提示例では単に delete [] c; とすればよいわけで何の問題も無い
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.