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

Discussion

The scope of an automatic variable is:

  • A.Within the block it appears
  • B.Within the blocks of the block it appears
  • C.Until the end of program
  • D.Both (a) and (b)

Answer: D

Correct answer: Both (a) and (b)

An automatic variable is visible from its declaration to the end of the block that contains it, and that includes any blocks nested inside - unless one of them declares another variable of the same name, which shadows it.

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

Post your comment

Please log in or register to post a comment.