Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Re: default Enu...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 8 of 8 Topic 45816 of 46738
Post > Topic >>

Re: default Enum values?

by Greg Herlihy <greghe@[EMAIL PROTECTED] > May 10, 2008 at 03:00 AM

On May 10, 1:39=A0am, brno <brno.barutc...@[EMAIL PROTECTED]
> wrote:
>
> Static ("global") variable are default initialize (int for example is 0)
> Is it undefined even if it is part of a global object ? For example in:
>
> main.cc:
> --------
>
> class A {
> =A0 =A0 =A0Days d;
>
> };
>
> A globalA;
>
> int main() {}

No, global objects are always zero-initialized (before any dynamic
initialization is performed). So in example above, globalA.d will have
the value zero.

Greg
 




 8 Posts in Topic:
default Enum values?
Travis <travis.bowers@  2008-05-08 15:37:37 
Re: default Enum values?
Ian Collins <ian-news@  2008-05-09 11:12:25 
Re: default Enum values?
brno <brno.barutchek@[  2008-05-10 10:39:30 
Re: default Enum values?
Ian Collins <ian-news@  2008-05-10 20:52:50 
Re: default Enum values?
Travis <travis.bowers@  2008-05-08 16:44:32 
Re: default Enum values?
Ian Collins <ian-news@  2008-05-09 11:58:27 
Re: default Enum values?
Travis <travis.bowers@  2008-05-08 16:53:47 
Re: default Enum values?
Greg Herlihy <greghe@[  2008-05-10 03:00:40 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Jul 9 0:28:16 CDT 2008.