class ClassB; class ClassA { // ClassB is a friend class of ClassA friend class ClassB; ... .. ... } class ClassB { ... .. ... }