Multiple choice

Which storage class allows local variables to maintain their values between function calls?

  1. Auto

  2. Register

  3. Static

  4. Extern

  5. Intern

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

The static storage class instructs the compiler to keep a local variable in existence during the lifetime of the program instead of creating and destroying it each time it comes into and goes out of scope. Therefore, making local variables static allows them to maintain their values between function calls.