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

Discussion

In C, a global variable that is not explicitly initialised is set to ________.

  • A.a junk value
  • B.zero
  • C.the value of the last assignment
  • D.an implementation-defined constant

Answer: D

Correct answer: zero

Variables with static storage duration, which includes all globals, are zero-initialised before the program starts. It is local variables of automatic storage duration that hold indeterminate values until assigned.

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

Post your comment

Please log in or register to post a comment.