Question.5
A class allocates an array and frees it with the wrong delete:
class Pool {
Sensor* sensors;
public:
Pool(int n) : sensors(new Sensor[n]) {}
~Pool() { delete sensors; } // Wrong! Should be delete[]
};What happens when a Pool object is destroyed?