Are global variables automatically declared as static and initialized to 0? What ANSI says about this?
Thanks for any answer!
This is a discussion on Global variables question(very simple) within the C++ Programming forums, part of the General Programming Boards category; Are global variables automatically declared as static and initialized to 0? What ANSI says about this? Thanks for any answer!...
Are global variables automatically declared as static and initialized to 0? What ANSI says about this?
Thanks for any answer!
Nothing more to tell about me...
Happy day =)
>Are global variables automatically declared as static and initialized to 0?
If by global variable you mean this:
Then yes, the standard guarantees that a will have static linkage and be initialized to 0.Code:int a; // Global int main() { ... }
p.s. What the alphabet would look like without q and r.