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?
bus
Select Answer
Yes -- references can be assigned in the body
No -- references must be initialized at creation; the initializer list is the only valid place
Yes -- but only if the reference is mutable
No -- references cannot be class members