Practice ยท 3 of 3
override catches the bug
Implement class Sensor with virtual std::string reading() const returning "base", and class TempSensor : public Sensor overriding it to return "22C". The signature must match exactly (const included) and the override must use the override keyword.
Difficulty: intermediate
Press Submit to check your solution.
Back to lesson: Practice: Polymorphism and the virtual destructor rule