Polymorphism in C++
-
Sir, I am student of Punjab University College of Information Technology, Lahore, Pakistan I have problem while using Borland C++ v3.1. Problem: ========= The size of an object in virtual inheritance increases 2 bytes Class base { public: int b; base() {} virtual void f() {} virtual void g() {} }; Class derive : virtual public base { public: int d; derive() {} virtual void f() {} virtual void g() {} }; ---------------------- derive d; cout<The object layout in figure is in following URL [OBJECT LAYOUT FIGURE](<a href=) */ The object layout where that extra 2 bytes are laid is drawn in atttchment with v-table layout. Please contact me at! informfarid@yahoo.com
-
Sir, I am student of Punjab University College of Information Technology, Lahore, Pakistan I have problem while using Borland C++ v3.1. Problem: ========= The size of an object in virtual inheritance increases 2 bytes Class base { public: int b; base() {} virtual void f() {} virtual void g() {} }; Class derive : virtual public base { public: int d; derive() {} virtual void f() {} virtual void g() {} }; ---------------------- derive d; cout<The object layout in figure is in following URL [OBJECT LAYOUT FIGURE](<a href=) */ The object layout where that extra 2 bytes are laid is drawn in atttchment with v-table layout. Please contact me at! informfarid@yahoo.com
mfareed_baig wrote: The object layout in figure is in following URL OBJECT LAYOUT FIGURE I think you better re-check this hyperlink. It is incorrect.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen