472,989 Members | 3,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,989 software developers and data experts.

Virual Functions mechanism

Ram
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
Oct 17 '06 #1
2 1454
* 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?
Oct 17 '06 #2
"Ram" <ra******@yahoo.comwrites:

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
Oct 17 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jim Newton | last post by:
hi all, i'm relatively new to python. I find it a pretty interesting language but also somewhat limiting compared to lisp. I notice that the language does provide a few lispy type nicities, but...
5
by: Pratik | last post by:
what are callback functions? Where we require callback functions? In what scenario we require callback functions?
6
by: puzzlecracker | last post by:
Is there a case where having an "inline function" is more effective and less code i.e. code clean, but we still resort to use a regular function for this purpose? Another question, which I...
9
by: Rouben Rostamian | last post by:
Consider the following illustrative program: #include <stdio.h> double f(double x) { return x*x; } double g(double x)
52
by: lcw1964 | last post by:
Greetings, all, I am trying to port a little bit of math code to gcc, that in the original version used the long double version of several functions (in particular, atanl, fabsl, and expl). I...
4
by: Klaas Vantournhout | last post by:
Hi, I try to set a function pointer to a pure virtual functions in the base class itself. To shorten, assume the following code class base { public: base() { base::Fptr = &base::F;}
6
by: Gerhard Prilmeier | last post by:
Hello, I have an unmanaged C++ API that uses virtual functions, like this: class A { public: virtual void handleMe(){} };
1
by: Arun Kumar Surendran | last post by:
what is the main use of virual directory how it work pls clear my doubt
13
by: JohnQ | last post by:
The implementation of classes with virtual functions is conceptually easy to understand: they use vtables. Which begs the question about POD structs: how are they associated with their member...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
3
SueHopson
by: SueHopson | last post by:
Hi All, I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.