C++ multilevel inheritance function calls -
consider multilevel inheritance between c++ classes. consider:
struct { void dummy1() { } }; struct b : { void dummy1() { } }; struct c : b { void dummy() { dummy1(); } void dummy1() { } }; struct d : c { void dummy1() { } }; struct e : d { void dummy1() { } };
given:
e e; e.dummy();
i want know dummy1 called. 1 defined in class c
or 1 defined in class e
?
also, confused in function call made in multilevel inheritance, in case of virtual functions etc. can 1 suggest book or article can me in understanding this. googled lot not able find helpful.
thanks in advance.
i want know
dummy1
called. 1 defined in classc
or 1 defined in classe
?
given code, call 1 defined in c
.
if want call 1 defined in e
, you'll have make dummy1
virtual
function.