Multiple choice

What does the auto specifier do?

  1. It automatically initializes a variable to 0.

  2. It indicates that a variable's memory will automatically be preserved.

  3. It automatically increments the variable when used.

  4. It automatically initializes a variable to NULL.

  5. It indicates that a variable's memory space is allocated upon entry into the block.

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

The auto specifier in C indicates that a variable's memory storage duration is automatic - it's allocated when the block is entered and automatically deallocated when the block exits. This is the default storage class for local variables.