order of initialization

Discussion in 'C++' started by Wolfgang Jeltsch, Jul 28, 2003.

  1. Hello,

    consider the following code:
    class C {
    public:
    C();

    private:
    int a;
    int b;
    };

    C::C() : a(0), b(a) {}
    Is a guaranteed to be initialized when b is getting initialized so that b
    gets the value 0?

    Wolfgang
     
    Wolfgang Jeltsch, Jul 28, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. JKop
    Replies:
    10
    Views:
    975
  2. Matthias Kaeppler
    Replies:
    2
    Views:
    464
    Victor Bazarov
    Jul 18, 2005
  3. Replies:
    6
    Views:
    476
    Ron Natalie
    Dec 11, 2005
  4. toton
    Replies:
    5
    Views:
    947
    Victor Bazarov
    Sep 28, 2006
  5. Jess
    Replies:
    23
    Views:
    958
Loading...

Share This Page