91. Basics of Classes

Question.5

A developer creates a GPIO class with an initializer list:

class GPIO {
   int pin;
   bool state;
public:
   GPIO(int p) : pin(p), state(false) {
       configure_pin(pin);
   }
};

GPIO led(13);

When is pin initialized?

Need Help? Refer to the Quick Guide below

Select Answer