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 class c or 1 defined in class e?

given code, call 1 defined in c.

if want call 1 defined in e, you'll have make dummy1 virtual function.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -