Original Post
I working on a school project and i'm having a bit of problem with inheritance. Have a look at this code:
#includeEdited by - alberto_balsalm on November 22, 2001 3:54:20 PM#include class A { protected: int z; }; class B : public A {}; class C : public A {}; class D : public B, public C {}; int main(int argc, char **argv) { D d; cout << d.z; getch(); } [/Code] This code give me the following error message: [C++Error] Project2.cpp(23): Member is ambiguous: 'A::z' and 'A::z'. I want to inherit the objects like that but I don't know how to fix it. Anyone know what to do?