Original Post
Is it always the case that regardless of compiler settings, a virtual class instance has the address to the virtual function pointer table at the same location as that of the base class? Assume MS VC.Net as the compiler. For example,
class CBase
{
public:
CBase()
{
printf( "BASE construct\n" );
}
virtual ~CBase()
{
printf( "Base destroy\n" );
}
virtual void BaseFunc1()
{
printf( "BaseFunc1\n" );
}
virtual void BaseFunc2()
{
printf( "BaseFunc2\n" );
}
virtual void BaseFunc3()
{
printf( "BaseFunc3\n" );
}
int a;
};
void main()
{
CBase b;
}
Will the __vfptr member variable of b be always the address of b? Happy New Year & may you guys be blessed with long life & prosperity. Anis