Question.1
A function has a static local counter:
void count() { static int n = 0; n++; printf("%d ", n); } count(); count(); count();
What is the output?
Select Answer
1 1 1 -- n is reset each call
1 2 3 -- static local variables persist across function calls; n is initialized only once
0 1 2
Undefined -- static locals have no guaranteed behavior