New article – How inheritance, encapsulation and polymorphism work in C++

This concludes a month of work. Somehow I, again, ended up with huge article and explains lots of different things.

In this article, I am explaining how the three whales of OOP implemented in C++. How encapsulation works. How overloading of methods works. What is the structure of C++ object compared to C structure. How polymorphism works. What’s the structure of virtual methods table and how inheritance affects it. And many other things. Hope you will find it interesting. Read it here.

Did you know that you can receive periodical updates with the latest articles that I write right into your email box? Alternatively, you subscribe to the RSS feed!

Want to know how? Check out
Subscribe page

3 Comments

  1. Daniil says:

    Once I had question, I haven’t find answer yet, so I want ask you?

    When the sizeof of class isn’t equal to sizeof of object of that class?

    For example:

    class A
    {
    };

    A a;

    sizeof(A) != sizeof(a);

    Thanks

  2. To be honest I have no idea :-) I think I saw someone mentioning this. Anyway, I’ll post the answer here if I run into it.

  3. norbert novat says:

    how encapsulation work in c++

Leave a Reply

Prove you are not a computer or die *