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

Discussion

A name that is declared but never used is

  • A.silently removed from the source by the compiler
  • B.impossible, since every declaration creates a use
  • C.legal, though a compiler may issue a warning about it
  • D.an error that must be reported and compilation stopped

Answer: C

Unused declarations are legal in almost every language. A warning is helpful because such a declaration often indicates a typing mistake or leftover code. Treating it as an error would break a great deal of legitimate code.

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

Post your comment

Please log in or register to post a comment.