Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
inheritance
//Title of this code #include <iostream> using namespace std; class A { public: virtual void foo(int a) { cout << "A_foo" << a << endl;; } }; //template<class T> class B : public A { public: void foo(int a) { cout << "B_foo" << a << endl;; } }; class C : public B { public: void foo(int a) { cout << "C_foo" << a << endl;; } }; int main() { A *val = new C(); val->foo(1); std::cout << "Hello, world!\n"; }
run
|
edit
|
history
|
help
0
Lex cpp
Generating π from 1,000 random numbers
derive* -> gcc
ISPrime
MemCpySetChar
NonparaU
Motsow
Comp Conexe
Tejas choudhari
UsingAlgorithm