Sounds like you might need a factory. class factory { factory(int num, a *A, b *B) { A =new a(num); B = new b(num, a,C); } }; class a { private: // THIS IS IMPORTANT! a(...) friend class factory class C; ... } class b { private: // AGAIN, IMPORTANT b(...) ... } Note that I skiped some details, that you will need to take care of, but this should give the idea. It occurs to me that you could do this differently with a static vector. I don't use the STL (I have to support a compiler that doesn't support modern C++), but something like this instead: class Cfactory { private: static STL::vector Cs; // I'm not sure about this syntax! The static is critical to this though static getSharedC(num) { c *C; if((C = Cs[num]) == NULL) { C = new c(num); Cs.add(num,C); } return C; } }; Again, I left out a lot of details, and I'm not even sure how the vector class works, but you should be able to make it work. The last has two major problems! The first is easy to work around, but the second could be a show-stopper. First, you need something to prevent memory leaks. Reference counting is easiest (that I know of, maybe a smart pointer would work?), something needs to make sure that c1 goes away only after both a1 and b1 is deleted. Second, this gives you global context for all c1. You can't have different two parts of the code creating their own a1, because even though the a1 class is different, those two instance share the same c1! You need to figure out how to deal with this. I can't think of anything that I'd really trust.