156. Polymorphism-i

Question.1

A base pointer calls a virtual function:

class Protocol {
public:
   virtual void send(uint8_t d) { printf("Generic"); }
};
class UART : public Protocol {
public:
   void send(uint8_t d) override { printf("UART"); }
};

Protocol* p = new UART();
p->send(0x55);

What is printed?

Need Help? Refer to the Quick Guide below

Select Answer