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

Discussion

A variable declared static at file scope has

  • A.external linkage, so any file may refer to it
  • B.no storage of its own until first assigned
  • C.internal linkage, so it is invisible outside that file
  • D.automatic storage, so it is destroyed on return

Answer: C

Restricting the name to one translation unit is the C way of making a module's state private, and it is worth doing for every variable that is not part of an interface. Inside a function the same keyword means something related but distinct.

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

Post your comment

Please log in or register to post a comment.