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

Discussion

Under the most closely nested rule, a use of a name refers to

  • A.the first declaration of that name anywhere in the program
  • B.the declaration found in the outermost scope of the whole program
  • C.whichever declaration appears last in the source text
  • D.the declaration in the innermost enclosing scope that declares it

Answer: D

An inner declaration hides an outer one of the same name for the extent of the inner block. This is the rule almost every block structured language adopts. The alternative, where an inner declaration is simply an error, is rare.

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

Post your comment

Please log in or register to post a comment.