100. Constructors-II

Question.3

A developer uses one constructor to call another:

class SPI {
   int speed;
   int mode;
public:
   SPI(int s, int m) : speed(s), mode(m) { init_hw(); }
   SPI(int s) : SPI(s, 0) {}  // Delegates to 2-arg version
   SPI() : SPI(1000000) {}     // Delegates to 1-arg version
};

What does SPI() do?

Need Help? Refer to the Quick Guide below

Select Answer