4 extern "C" int printf (const char *, ...);
8 myFoundation () { count = 0; }
9 virtual ~myFoundation () {}
12 void addRef () { ++count; }
13 void removeRef () { if (count > 0) --count; }
20 class firstIntermediate :virtual public myFoundation {
22 firstIntermediate () {}
23 ~firstIntermediate () {}
25 void bar () { printf ("Bar\n"); }
29 class firstBase : public firstIntermediate {
38 class secondIntermediate : virtual public myFoundation {
40 secondIntermediate () {}
41 ~secondIntermediate () {}
47 class secondBase : public secondIntermediate {
56 class typeInterface : virtual public firstBase {
64 class classServices : virtual public firstBase,
73 class classImplementation : public typeInterface,
74 public classServices {
76 classImplementation () {}
77 ~classImplementation () {}
86 firstBase* fbp = new classImplementation;
87 classImplementation* cip = dynamic_cast <classImplementation*> (fbp);
89 myFoundation* mfp = cip;