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?
pin
Select Answer
After the constructor body runs
During the initializer list, before the constructor body -- pin is set to 13 before configure_pin runs
Only when first accessed
At compile time