initial check in

This commit is contained in:
2012-12-06 21:43:03 +04:00
commit 4bc273824d
179 changed files with 29415 additions and 0 deletions

42
virtual_overriding.cpp Normal file
View File

@@ -0,0 +1,42 @@
#include <stdio.h>
class A
{
public:
virtual A* fun()
{
puts( "A* fun()" );
return new A;
}
};
class B
{
public:
virtual B* fun1()
{
puts( "B* fun()" );
return new B;
}
};
class C : public B, public A
{
public:
virtual C* fun()
{
puts( "C* fun()" );
return new C;
}
};
int main()
{
A* p = new C;
A* p_f = p->fun();
return 0;
}