Comments on: How inheritance, encapsulation and polymorphism work in C++ http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp Tue, 16 May 2023 15:06:12 +0000 hourly 1 https://wordpress.org/?v=4.9.23 By: JS Objects: Inherited a Mess http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-2#comment-31438 Mon, 22 Apr 2013 19:52:02 +0000 http://www.alexandersandler.net/?page_id=474#comment-31438 […] course, a main pillar of inheritance-oriented coding is overriding and polymorphism, which allows an object toautomatically access the most descendant definition for a method, but […]

]]>
By: Sundaram http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-2#comment-29955 Wed, 17 Oct 2012 14:00:22 +0000 http://www.alexandersandler.net/?page_id=474#comment-29955 In g++ passing -fdump-class-hierarchy gives the a detailed layout dump file of all the classes in the passed file.

]]>
By: Alexis YL Chan http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-2#comment-29812 Wed, 29 Aug 2012 23:01:08 +0000 http://www.alexandersandler.net/?page_id=474#comment-29812 @Hesam – The answers in this StackOverflow question may answer #2: http://stackoverflow.com/questions/1825653/how-to-check-code-generated-by-c-compiler

In Visual Studio, set debug point and open disassembly.
In g++, do g++ -S to generate a .s assembly file.

]]>
By: Hesam http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-29811 Wed, 29 Aug 2012 22:50:01 +0000 http://www.alexandersandler.net/?page_id=474#comment-29811 Thank you, the information was great and was what I really looking for.

1- Is there a good and complete reference (i.e. Book) for this? I mean the topic of how compiler translates my code. (like when compiler sees the inheritance)
2- Is there any tool to know how the compiler translates code(for example in gcc, visual studio) and I can see what you said about objects’ memory.

]]>
By: ralu http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-29735 Tue, 14 Aug 2012 15:37:03 +0000 http://www.alexandersandler.net/?page_id=474#comment-29735 This is great. I just have two questions. 1. Isn’t virtual table of tree D-G-X is actually just virtual table D-G and B-E-H-X is B-E-H (and why not)? Can somebody explain how RTTI is implemented?

]]>
By: Alexis YL Chan http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-29522 Tue, 12 Jun 2012 17:01:16 +0000 http://www.alexandersandler.net/?page_id=474#comment-29522 @Alexander Sandler@Alexander Sandler – The ACFX vs ACDGX problem can be solved via virtual inheritance (instead of virtual methods) according to the C++ FAQ . What do you think? Thanks for the informative article!

]]>
By: Rasmi Ranjan Nayak http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-29445 Fri, 01 Jun 2012 06:03:39 +0000 http://www.alexandersandler.net/?page_id=474#comment-29445 Excellent Tutorial with pictorial representation………
I was planning to write an article on Polymorphism. But I think this is the best article ever written.
Good Luck… Keep writing…
Let me know if you have another technical blogs.

]]>
By: lata http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-28986 Wed, 14 Mar 2012 11:54:56 +0000 http://www.alexandersandler.net/?page_id=474#comment-28986 Very nice tutorial!!
Very precise and within short time we can understand the concepts very well.

]]>
By: X. Huang http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-28636 Fri, 17 Feb 2012 21:37:46 +0000 http://www.alexandersandler.net/?page_id=474#comment-28636 Precise, well-written, and useful page.
Thank you!

]]>
By: Alexander Sandler http://www.alexonlinux.com/how-inheritance-encapsulation-and-polymorphism-work-in-cpp/comment-page-1#comment-28433 Sun, 05 Feb 2012 20:54:56 +0000 http://www.alexandersandler.net/?page_id=474#comment-28433 @kapil chaudhary
There is a bug in commenting system of my web-site (wordpress). When you post some code in the comment, it gets totally screwed up. Same thing happened to your code and now I cannot see what exactly you mean by that. If you still want me to take a look at this, please send me an email.
Thanks and sorry for the inconvenience.

]]>