blob: 1752573c6865402760e37b6da6ecbe386a9a5c0c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#include <stdio.h>
struct Support {
virtual void f() { printf("f()\n"); }
};
struct Derived : Support {};
int main() {
Support* p = new Derived;
dynamic_cast<Derived*>(p)->f();
}
|