100. Constructors-II

Question.6

A driver class holds a reference to a shared bus:

class SensorDriver {
   I2C_Bus& bus;
public:
   SensorDriver(I2C_Bus& b) : bus(b) {}
};

Can bus be initialized in the constructor body instead of the initializer list?

Need Help? Refer to the Quick Guide below

Select Answer