Main should return an int but anyways why can't you compile it yourself? Or are you just not willing to compile it yourself? Or you could alternatively follow the code
Also keep in mind globals are 0 initaliEd and statics have a lifetime of globals but in this case local to a function
Output of g is undefined. You don't initialize it.
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.
Output of g is undefined. You don't initialize it.
Global variables are zero-initialized:
Standard wrote:
3.6.2 Initialization of non-local variables [basic.start.init] 2Variables with static storage duration (3.7.1) or thread storage duration (3.7.2) shall be zero-initialized (8.5) before any other initialization takes place.