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 7024973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:54:47+00:00 2026-05-27T23:54:47+00:00

This is in fact an interview question, I can’t figure out the answer. Anyone

  • 0

This is in fact an interview question, I can’t figure out the answer. Anyone knows about this?
You can talk about any difference, for example, the data that are push into stack.

  • 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-05-27T23:54:48+00:00Added an answer on May 27, 2026 at 11:54 pm

    Though virtualism/dynamic dispatch is strictly implementation defined, most(read all known) compilers implement it by using vptr and vtable.

    Having said that, the difference between calling a non virtual function and virtual function is:

    Non-virtual functions are resolved statically at Compile-time, While Virtual functions are resolved dynamically at Run-time.

    In order to achieve this flexibility of being able to decide which function to call at run-time,
    there is an little overhead in case of virtual functions.

    An additional fetch call that needs to be performed and it is the overhead/price you pay for using dynamic dispatch.

    In case of non-virtual function the sequence of calls is:

    fetch-call
    

    The compiler needs to fetch address of the function and then call it.

    While in case of virtual functions the sequence is:

    fetch-fetch-call
    

    The compiler needs to fetch the vptr from the this, then fetch the address of the function from the vptr and then call the function.

    This is just a simplified explanation the actual sequence maybe far more complex than this but this is what you really need to know, One does not really need to know the implementation nitty gritty’s.

    Good Read:

    Inheritance & Virtual Functions

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

Sidebar

Related Questions

This is a question for a homework problem that I cant figure out: Question
I always found this rather annoying fact about applets, that they disappear if you
this one is not homework, it just the fact that i've been out of
In fact I have Idea about the exception handling. But while facing the interview
(This question is related to my previous question , or rather to my answer
Got this question in an interview today, and its optimized solution stopped me cold
This question grew out of SQLServer: Why avoid Table-Valued User Defined Functions? . I
This question might appear very simple, but i haven't found an answer yet, so
I was asked this question in a phone interview for summer internship, and tried
I went to a job interview today and was given this interesting question. Besides

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.