#include <iostream>
#include <typeinfo>

struct foo{
	public:
	 virtual ~foo(){}
	};

struct bar : foo{};

int main() {
	bar *pbar = new bar;
	foo *pfoo = pbar;
	std::cout << typeid(foo).name() << std::endl;
	std::cout << typeid(bar).name() << std::endl;
	std::cout << typeid(*pfoo).name() << std::endl;
	std::cout << typeid(*pbar).name() << std::endl;
	delete pbar;
}