20. Default Function Arguments

Question.4

A developer puts default values in the .cpp definition instead of the .h declaration:

Header (driver.h):

void timer_start(int period_ms, int priority);

Source (driver.cpp):

void timer_start(int period_ms, int priority = 3) {
   // setup...
}

Another file calls timer_start(100);. What happens?

Need Help? Refer to the Quick Guide below

Select Answer