order of initialization

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Wolfgang Jeltsch

    order of initialization

    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
Working...