25 lines
251 B
C++
25 lines
251 B
C++
#include <iostream>
|
|
using namespace std;
|
|
|
|
class C {
|
|
|
|
public:
|
|
virtual void print();
|
|
};
|
|
|
|
|
|
class CC:public C {
|
|
public:
|
|
void print() {
|
|
cout<<"CC"<<endl;
|
|
}
|
|
};
|
|
|
|
int main() {
|
|
|
|
CC* c = dynamic_cast<CC *>(new C);
|
|
//c->print();
|
|
}
|
|
|
|
|