473,320 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 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 1465
* 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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.