Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
CPP Multi Inherit
//g++ 5.4.0 #include <iostream> class Base{ public: void test(){ std::cout << "Base: not virtual\n"; } virtual void vtest(){ std::cout << "Base: virtual\n"; } }; class Inherit:public Base{ public: void test(){ std::cout << "Inherit: not virtual\n"; } virtual void vtest(){ std::cout << "Inherit: virtual\n"; } }; class InheritedInherit:public Inherit{ public: void test(){ std::cout << "InheritedInherit: not virtual\n"; } virtual void vtest(){ std::cout << "InheritedInherit: virtual\n"; } }; int main() { Base* b = new Inherit(); Base* bi= new InheritedInherit(); Inherit* i=new InheritedInherit(); b->test(); b->vtest(); std::cout << std::endl; bi->test(); bi->vtest(); std::cout << std::endl; i->test(); i->vtest(); std::cout << std::endl; }
run
|
edit
|
history
|
help
0
My love
2
map_find
DP Optimization another kind
Ballin primality test
a simple tuple implementation
weird cast in qt moc files
Stream generalization
GRAPH DFS & BFS
Podejrzana karteczka :0