Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8278921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:09:39+00:00 2026-06-08T09:09:39+00:00

If Base is a base class and Derived a derived class and there are

  • 0

If Base is a base class and Derived a derived class and there are 25 instances of Derived, how are the vtables set up to be accessed by all the instances? Where are they loaded in the memory?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T09:09:41+00:00Added an answer on June 8, 2026 at 9:09 am

    Compilers are allowed to implement dynamic dispatch however they want in c++, i don’t think there is actually any requirement to even use a vtable at all, but it would be very unusual to find a compiler that didn’t.

    In most cases i think that each class (that contains some virtual methods) will own a single vtable (so if i had 5 instances of class A i will still only have 1 vtable), but this behaviour should not be relied upon in any way.

    Non virtual classes have no need for vtables as far as i know.

    Reading your question it seems as if you think that each object has its own copy of the code, I’m not sure and i don’t want to accuse you of anything like that but just in case …

    Google something like: “what does a c++ object look like in memory”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to overload base template class functions in derived classes, and
In my project, there is one Base class and there are 3 different derived
I have a set of classes which are all derived from a common base
vtable is an overhead in all base/derived classes when a base class has a
I have these classes: class Base { ... private: std::vector<X> v; }; class Derived
Suppose I have a Base class and its derived class Derived as follows: class
I have a c++ class derived from a base class in a framework. The
If I allocate an object of a class Derived (with a base class of
I have a base class A and a derived class B . class A
I have a base class A and a derived class B: class A {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.