// test_public_parent.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include <iostream>

struct a
{
	virtual void f()
	{ std::cout << "a::f()\n" ; }
};

struct b : public a
{
	virtual void g()
	{ std::cout << "b::g()\n" ; }
};

struct c : public a
{
	virtual void g()
	{ std::cout << "c::g()\n" ; }
};

struct d : public b, protected c
{
	virtual void g()
	{ std::cout << "d::g()\n" ; }
};


int _tmain(int argc, _TCHAR* argv[])
{
	d o;

	d * pd = &o;

	a * pa = static_cast<a*>(pd);

	pd->f();

	return 0;
}

