lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> #include <iostream.h>
> class Base1 { public: int b1; };
> class Base2 { public: int b2; };
> class Derived : public Base1, public Base2 {};
> void main( void )
>     {
>     Derived derived;
>     void * pDerived = & derived;
>     void * pBase1 = ( Base1 * ) & derived;
>     void * pBase2 = ( Base2 * ) & derived;
>     cout << pDerived << endl << pBase1 << endl << pBase2 << endl;
>     }
> 
> On my system, this outputs:
> 
> 0x0012FF6C
> 0x0012FF6C
> 0x0012FF70

Nicely done. Thanks a lot Ashley, I'd never thought of that. I guess my
classes inherit all inherit in the right order :)
I'll check that when I'm back home.

-- 
Vincent Penquerc'h