Consider the following code:
class A { public: int i; A() {} }; class B { public: A a; int i; }; int main() { B* p = new B {}; std:
Integral types are not required to be initialized to a value like that in a non-default constructor (since you have provided a constructor)
Change your constructor to A() : i(0) {}.
A() : i(0) {}