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?
Select Answer
Yes — the comma placeholder skips the default argument
No — C++ does not allow skipping middle arguments; you must provide parity explicitly to set stop
Yes — but only in C++20 with designated initializers
No — but you can use nullptr as a placeholder