← Quiz: Storage Classes in C: all 15 questions
Quiz: Storage Classes in C · Question 14 of 15
Which variable keeps its value between calls but can be used only inside its own function?
Which variable keeps its value between calls but can be used only inside its own function?
- A.A global variable
- B.An auto local variable
- C.A static local variable
- D.A register variable
Answer & explanation
Correct answer: A static local variable
A static local has the lifetime of a global and the scope of a local.
Can you get the rest right without peeking?
Take the timed Quiz: Storage Classes in C quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →