Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
python
stack::swap_30-Seconds-of-C++
SEJM BLURWA
matrix2
PascalTriangle
always_late
krack
Test 11(2020)
Rectangle overlap
Shultz_Lab2.CPP
Please log in to post a comment.