Question.2
A developer writes a function that returns a reference to a config value:
int& get_default_baud() { int baud = 9600; return baud; } int &rate = get_default_baud(); printf("%d", rate);
What happens?
Select Answer
Prints 9600 — the value is preserved after the function returns
9600
Prints 0 — local variables are zeroed after function exit
0
Undefined behavior — baud is a local variable that no longer exists
Compilation error — functions cannot return references