Sobes.tech
Junior

Millised on kaks delete operaatori tüüpi C++-s?

sobes.tech AI

Vastus AI-lt

The first type is delete for removing a single object. It calls the object's destructor (if it exists) and frees the memory allocated for the object.

The second type is delete[] for removing a dynamic array of objects. It sequentially calls destructors for each element of the array and then frees the memory block allocated for the array.