QuesHub > 对象 > 函数 > 内存 > ASK DETAIL

What is delete operator in C++ 2024?

Amelia Turner | 2023-05-05 10:25:56 | page views:1323
I'll answer
Earn 20 gold coins for an accepted answer.20 Earn 20 gold coins for an accepted answer.
40more

Cameron Powell

Works at Square, Lives in San Francisco, CA
Using delete on a pointer to an object not allocated with new gives unpredictable results. ... When delete is used to deallocate memory for a C++ class object, the object's destructor is called before the object's memory is deallocated (if the object has a destructor).
2023-05-06 10:25:56

Amelia Kim

QuesHub.com delivers expert answers and knowledge to you.
Using delete on a pointer to an object not allocated with new gives unpredictable results. ... When delete is used to deallocate memory for a C++ class object, the object's destructor is called before the object's memory is deallocated (if the object has a destructor).
ask:3,asku:1,askr:137,askz:21,askd:152,RedisW:0askR:3,askD:0 mz:hit,askU:0,askT:0askA:4