Machine-translated by Google. Questions are authored in English.
Top

Discussion

Automatic variables:

  • A.Exist only within that scope in which it is declared
  • B.Cease to exist after the block is exited
  • C.Only 1
  • D.Both (a) & (b)

Answer: D

Correct answer: Both (a) & (b)

Both statements describe the same property from two sides: an automatic variable exists only within its block, and it ceases to exist when the block is left. Its storage on the stack is reclaimed at once, which is why returning a pointer to one is a bug.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.