What is delete operator in C++ 2024?
I'll answer
Earn 20 gold coins for an accepted answer.20
Earn 20 gold coins for an accepted answer.
40more
40more
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
评论(499)
Helpful(122)
Helpful
Helpful(2)

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).