Last Updated : 09 Nov, 2018

Consider the following statement regarding memory allocation:

  • I – Memory will be created only once for a static variable at runtime.
  • II – Static variable will be initialized only for once and its initial value will be 0 by default.
  • III – If binding happened at compile time then it can be changed at run time.

Which of the following statement is incorrect.
(A) Only I and III
(B) Only II and III
(C) Only II
(D) All of these.


Answer: (A)

Explanation:

  • I – In static storage allocation memory will be created at compile time in the static area, i.e., memory will be created only once for the static variable (lexical analyzer will scan the program only for once).
  • II – Static variable will be initialized only for once and its initial value will be 0 by default.
  • III – If binding happened at compile time then it can\’t be changed at run time.

Therefore, only statement I and III are not correct.

Option (A) is correct.


Quiz of this Question


Share your thoughts in the comments