Given the code sample:
class B {
//Some contents.
};
class C {
private:
B& b;
};
class A {
private:
B b;
C c;
};
Class C has a reference to a b, so it needs to be initialized with it. Class A contains an instance of B and an instance of C.
My question is: Can I initialize the C instance in A with the B instance in A (assuming I did bother to put the constructors in)? Secondly, do I need to perform any explicit initialization of the B in A, or is it default initialized since its a class type within a class?