dev/cpp/static_cast/static_cast.cpp

15 lines
118 B
C++

class A {
public:
void f () {}
};
int main (void)
{
A a;
void *p = &a;
static_cast<A*>(p)->f();
return 0;
}