Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
多态
//g++ 5.4.0 #include <iostream> class LBlob { public: LBlob() { std::cout << " LBLOB con " << std::endl;} virtual ~LBlob() {std::cout << " LBLOB desturct " << std::endl;} virtual void A() {std::cout << " A " << std::endl;} }; class XXX { public: XXX() { std::cout << " XXX con " << std::endl;} ~XXX() {std::cout << " XXX desturct " << std::endl;} }; class CacheLBlob : public LBlob { public: CacheLBlob() { std::cout << " CacheLBlob con " << std::endl;} ~CacheLBlob() {std::cout << " CacheLBlob desturct " << std::endl;} void A() {std::cout << " B " << std::endl;} private: XXX x; }; int main() { std::cout << "Hello, world!\n"; LBlob *c = new CacheLBlob; c->A(); delete c; }
run
|
edit
|
history
|
help
0
Test 11(2020)
multimap
Exempel 4
Using copy_n
Test Swap Functions
decode
123
Fibonacci
lab17feb22x4B.cpp
Microsoft - MaxEmployeeAttendence (R repititions - 1st step towards DP.)