20. Default Function Arguments

Question.6

A developer wants to call this function with default parity but custom stop bits:

void uart_init(int baud, int parity = 0, int stop = 1);

He writes:

uart_init(9600, , 2);  // Skip parity, set stop=2

Will this work?

Need Help? Refer to the Quick Guide below

Select Answer