Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
int main(void) { const char* kung = "Foo"; delete []kung; }
このコードでは、なぜ次のようになるのdebug assert failed block_type_is_validですか?
debug assert failed block_type_is_valid
kung ポインターがメモリ内の割り当てを解除できない定数文字列を指しているためですか?
delete文字列リテラル (これがkung指すもの)を使用できないためです。
delete
kung
また、自動格納文字列を削除することもできません (したがって、実際にはリテラル部分ではありません)。
char kung[] = "Foo"; delete []kung; //still illegal
delete[]で割り当てるメモリのみnew[]。
delete[]
new[]