C++ Virtual Table - Explained thru Assemblies

Categories: cpp
C++ Virtual Table Code C++ Sources #include <string>#include <iostream> class Base { public: virtual const char* Name() const { return "Base"; } virtual const char* BaseName() const { return "Base"; } int a = 1; int t = 2; }; class DerivedC : public Base { public: virtual const char* Name() const override { return "Derived"; } int b = 3; double c = 4.0; }; int main() { Base* base = new DerivedC; base->Name(); base->BaseName(); delete base; return 0; } Compiled Assemblies .

Read More →