Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Virual Functions mechanism

Reply
Thread Tools

Virual Functions mechanism

 
 
Ram
Guest
Posts: n/a
 
      10-17-2006
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


 
Reply With Quote
 
 
 
 
Alf P. Steinbach
Guest
Posts: n/a
 
      10-17-2006
* 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?
 
Reply With Quote
 
 
 
 
Jens Theisen
Guest
Posts: n/a
 
      10-17-2006
"Ram" <(E-Mail Removed)> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Virual PC 64 bit and 32 bit questions... Bikini Browser Windows 64bit 6 03-29-2010 06:25 PM
pointer to pure virual function Klaas Vantournhout C++ 4 11-22-2006 07:46 PM
virual inheritance and base class initialisation free2cric@yahoo.com C++ 2 10-15-2005 12:08 AM
access server side files - outside of virual directory =?Utf-8?B?Q3JhaWc=?= ASP .Net 1 09-30-2005 07:43 PM
RAM Memory or virual memory Julián Sanz García ASP .Net 4 11-12-2004 06:25 PM



Advertisments