0

Explain, Please... Output is b How?

#include <iostream> using namespace std; class A {}; class B : public A {}; class C : public B {}; void method(A a) {cout<<'a';} void method(B b) {cout<<'b';} int main() { C c; method(c); return 0; } //Output is b

3rd May 2019, 4:16 AM
Sp Maurya
Sp Maurya - avatar
1 Odpowiedź
+ 3
Hmmm... i see got it...
3rd May 2019, 4:36 AM
Sp Maurya
Sp Maurya - avatar