default constructor
1 #include <iostream> 2 #include <vector> 3 4 using namespace std; 5 6 class B { 7 public: 8 int b; 9 B() {b=2;} 10 }; 11 12 class A { 13 public: 14 int a; 15 B b; 16 }; 17 int main() 18 { 19 vector<int> iv(10); 20 cout << iv.begin()-iv.end(); 21 22 A test; 23 cout << test.b.b; 24 cout << test.a; 25 }