I have a class A, which you can derive your own class from and use it to do various things. With the class there are a few functions, that will need access to the members of class A and the members of the derived class.
The problem is how do I make the function so it can access the members of the Base and Derived class, when I don't know what the derived class's name might be.
something like this i guess:
Code:class A { public: int a; }; class B : public A { public: int b; } //Im not sure what the parameters should be for the functions void FunctionFoo(A aa) { //Ill need access to the members of the derived class ( B ), but I dont know what the class name is. cout << aa.b << endl; }



LinkBack URL
About LinkBacks


