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

Discussion

The keyword that tells the compiler a variable is defined in another translation unit is

  • A.register
  • B.extern
  • C.static
  • D.volatile

Answer: B

The declaration in a header says the object exists somewhere and gives its type; exactly one source file must then define it. Putting a definition rather than a declaration in a header is how duplicate symbol errors arise.

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

Post your comment

Please log in or register to post a comment.