Virual Functions mechanism

Discussion in 'C++' started by Ram, Oct 17, 2006.

  1. Ram

    Ram Guest

    Hi,



    Please clarify my below mentioned doubts,



    1. Virtual functions addresses are stored in Virtual table, but how about
    the Virtual destructor?



    2. Is the Virtual destructor also treated as just like any other function
    except the calling mechanism?



    3. Could you please refer me a book/Website where I can find the detailed
    information about the Virtual function and internal details.? What happens
    at the compile time and Run time in detail?





    Thanks & Regards,

    Ram
    Ram, Oct 17, 2006
    #1
    1. Advertising

  2. * Ram:
    > Hi,
    >
    >
    >
    > Please clarify my below mentioned doubts,
    >
    >
    >
    > 1. Virtual functions addresses are stored in Virtual table,


    Are they?


    > but how about the Virtual destructor?


    Usually treated in exactly the same way as other virtual functions.


    > 2. Is the Virtual destructor also treated as just like any other function
    > except the calling mechanism?


    No.


    > 3. Could you please refer me a book/Website where I can find the detailed
    > information about the Virtual function and internal details.? What happens
    > at the compile time and Run time in detail?


    See <url: http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf>.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?
    Alf P. Steinbach, Oct 17, 2006
    #2
    1. Advertising

  3. Ram

    Jens Theisen Guest

    "Ram" <> writes:

    All of this is implementation dependent, though as far as I know they
    don't vary too much as far as you're questions are concerned.

    > 1. Virtual functions addresses are stored in Virtual table, but how about
    > the Virtual destructor?


    At least on my platform, there is technically more than one dtor, two
    of them virtual, one of them not. Don't ask me why.

    > 2. Is the Virtual destructor also treated as just like any other function
    > except the calling mechanism?


    As little as ctors are normal non-virtual functions.

    > 3. Could you please refer me a book/Website where I can find the detailed
    > information about the Virtual function and internal details.? What happens
    > at the compile time and Run time in detail?


    One unfortunately very outdated and also somewhat superficial book
    which is often cited when such questions come up is `Inside the C++
    object model'.

    I would nevertheless suggest it as a starting point, if you have
    access to it.

    Since it's platform dependent, you might find it documented for your
    platform. For example, gcc adheres to the Itanium C++ ABI (google for
    itanium and abi), even on systems other than Itanium, and Linux
    systems are required that their compiler do so by LSB.

    This document is a bit difficult to understand if you're not familiar
    with the basics though (admittedly I don't understand too much).

    It's still useful to realise _how_ complex matters are.

    --
    Cheers, Jens
    Jens Theisen, Oct 17, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Julián Sanz García

    RAM Memory or virual memory

    Julián Sanz García, Nov 12, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    888
    Julián Sanz García
    Nov 12, 2004
  2. =?Utf-8?B?Q3JhaWc=?=

    access server side files - outside of virual directory

    =?Utf-8?B?Q3JhaWc=?=, Sep 30, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    480
    Marina
    Sep 30, 2005
  3. Xiangliang Meng
    Replies:
    1
    Views:
    1,576
    Victor Bazarov
    Jun 21, 2004
  4. Replies:
    2
    Views:
    339
    Ron Natalie
    Oct 15, 2005
  5. Klaas Vantournhout

    pointer to pure virual function

    Klaas Vantournhout, Nov 22, 2006, in forum: C++
    Replies:
    4
    Views:
    473
    Pete Becker
    Nov 22, 2006
Loading...

Share This Page