Is initialisation mandatory for local static variables?

Is initialisation mandatory for local static variables? mcq and its answer is provided on this page.

Local Static Variable is a variable which exists even if the function execution is completed, it persists in memory until complete program is executed.

Local static variables are used to count how many times a function was called.

Is initialisation mandatory for local static variables?

Que. Is initialisation mandatory for local static variables?
a a) Yes
b b) No
c c) Depends on the compiler
d d) Depends on the standard
Answer: b
Explanation : None.


Comments