#include <iostream>
class base
{
public:
void print() { std::cout << "base" << std::endl; }
};
template< class B >
class der : public B
{
int i;
public:
virtual void print()
{
std::cout << (B *)this << std::endl; B::print();
}
};
int main(int, char **)
{
der< der< base > > inst;
inst.print();
}
output :
0xbf93de8
0xbf93de8
base
Any ideas why this prints the same pointer values?