mirror of
https://github.com/Light-City/CPlusPlusThings.git
synced 2026-05-06 05:01:34 +08:00
update
This commit is contained in:
24
codingStyleIdioms/5_pImpl/a.cpp~
Normal file
24
codingStyleIdioms/5_pImpl/a.cpp~
Normal file
@@ -0,0 +1,24 @@
|
||||
#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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user