I have this code and the exercise is to find out which error will occur if I build an Instance of my Class and delete it afterwards. I can't find the fault in the definition of this class so maybe you can help me. Here's the code:
class BadClass{ public: BadClass(){ p = new double; } ~BadClass () {} double getValue() {return *p;} void setValue(double v) {*p = v;} private: double* p; };