146. Inheritance

Question.1

A UART class inherits from SerialPort:

class SerialPort {
public:
   void open(int baud) { /* generic */ }
};

class UART : public SerialPort {
public:
   void set_parity(int p) { /* UART-specific */ }
};

UART u;
u.open(9600);
u.set_parity(1);

Where does open() come from?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!