Question.6
A class allocates a buffer in the constructor but has no destructor:
class DataLogger {
uint8_t* buf;
public:
DataLogger(int size) : buf(new uint8_t[size]) {}
// No destructor!
};
void log_data() {
DataLogger dl(256);
} // dl goes out of scopeWhat happens when dl is destroyed?