I have a base class called Packet:
// Header File
class Packet {
public:
virtual bool isAwesome() const {
return false;
}
}
and an inherited class called AwesomePacket:
// Header File
class AwesomePacket : public Packet {
public:
virtual bool isAwesome() const {
return true;
}
}
However, when I instantiate an AwesomePacket and call isAwesome(), the method returns false instead of true. Why is this the case?
virtual.