0

I have next class:

class IntArray
{
public:
    explicit IntArray(size_t a = 0) {
        this->poi = new int[a];
        this->siz = a;
    };
    ~IntArray() {
         delete[] this->poi;
     };
private:
    size_t siz;
    int* poi;
};

In main something like next code:

IntArray iaa(5);
iaa.~IntArray();

But compiler says that there is a heap corruption in destructor. What do I do wrong?

kileatb
  • 35
  • 6

0 Answers0