473,378 Members | 1,156 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,378 software developers and data experts.

What is Data Type of Vptr pointer

Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...

Regards,
Veeru

Sep 13 '06 #1
7 6860
Veeru wrote:
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...
Not sure what 'Vptr' you mean. Do you mean 'vtbl'? If so, it is not
defined in C++. It's an ipmlementation detail, and as such has no
representation/definition in C++ proper.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Sep 13 '06 #2

Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...

Regards,
Veeru
your question was answered in Marshall Cline's FAQs

see this..
http://www.parashift.com/c++-faq-lit....html#faq-20.4

-- Murali Krishna

Sep 14 '06 #3

Murali Krishna wrote:
Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...

Regards,
Veeru

your question was answered in Marshall Cline's FAQs

see this..
http://www.parashift.com/c++-faq-lit....html#faq-20.4

-- Murali Krishna
i searched in the FAQ but didnt find the answer to my question. i
wanted to know the data type of the Vptr pointer the points to the
Vbtl(virtual table) which contains the function pointers to virtual
functions.

Please help.

Regards,
Veeru

Sep 15 '06 #4

Veeru wrote:
Murali Krishna wrote:
Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...
>
Regards,
Veeru
your question was answered in Marshall Cline's FAQs

see this..
http://www.parashift.com/c++-faq-lit....html#faq-20.4

-- Murali Krishna

i searched in the FAQ but didnt find the answer to my question. i
wanted to know the data type of the Vptr pointer the points to the
Vbtl(virtual table) which contains the function pointers to virtual
functions.

Please help.

Regards,
Veeru
I think you have faced this in an interview. I have not seen about
VPtr's data-type till now. but as written in FAQs, you can understand
that it is a generic pointer (say void*) to a generic member function
because it stores the starting address of the V-Table.

I guess it is void*.

-- Murali Krishna.

Sep 15 '06 #5

Murali Krishna wrote:
Veeru wrote:
Murali Krishna wrote:
Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...

Regards,
Veeru
>
your question was answered in Marshall Cline's FAQs
>
see this..
http://www.parashift.com/c++-faq-lit....html#faq-20.4
>
-- Murali Krishna
i searched in the FAQ but didnt find the answer to my question. i
wanted to know the data type of the Vptr pointer the points to the
Vbtl(virtual table) which contains the function pointers to virtual
functions.

Please help.

Regards,
Veeru

I think you have faced this in an interview. I have not seen about
VPtr's data-type till now. but as written in FAQs, you can understand
that it is a generic pointer (say void*) to a generic member function
because it stores the starting address of the V-Table.

I guess it is void*.

-- Murali Krishna.

Thanks Murali for such a quick response.
There are two possibilities as far as i can see now:
1. Either Vptr could be a void *
OR
2. V-Table must be some kind of an internal hidden sturture or class.
And the Vptr points to the V-Table. So Vptr could have a data type of
V-Table.

Well, this is just what i can guess.
But still need a confimation.

Regards,
Veeru

Sep 15 '06 #6
Veeru wrote:
>
Murali Krishna wrote:
>Veeru wrote:
Murali Krishna wrote:

Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...

Regards,
Veeru

your question was answered in Marshall Cline's FAQs

see this..
http://www.parashift.com/c++-faq-lit....html#faq-20.4

-- Murali Krishna

i searched in the FAQ but didnt find the answer to my question. i
wanted to know the data type of the Vptr pointer the points to the
Vbtl(virtual table) which contains the function pointers to virtual
functions.

Please help.

Regards,
Veeru

I think you have faced this in an interview. I have not seen about
VPtr's data-type till now. but as written in FAQs, you can understand
that it is a generic pointer (say void*) to a generic member function
because it stores the starting address of the V-Table.

I guess it is void*.

-- Murali Krishna.


Thanks Murali for such a quick response.
There are two possibilities as far as i can see now:
1. Either Vptr could be a void *
OR
2. V-Table must be some kind of an internal hidden sturture or class.
And the Vptr points to the V-Table. So Vptr could have a data type of
V-Table.

Well, this is just what i can guess.
But still need a confimation.
There is no way to confirm this: the c++ standard does not even require that
v-tables exist. In particular, it does not prescribe the types and data
structures used to implement the dispatch mechanism for virtual functions.
Thus, your question does not have a general answer. If you are interested
in how a given implementation does it, then you should ask your question in
a forum dedicated to that particular implementation.
Best

Kai-Uwe Bux
Sep 15 '06 #7
Veeru wrote:
Hi ,
What is the data type of Vptr pointer used in the virtual funtion
mechanism?
i suppose its void. Please correct me if i am wrong...
Your question actually makes no sense - virtual function dispatch is a
language internal feature, and as such has nothing to do with the type
system.

Sep 15 '06 #8

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

Similar topics

4
by: Thomas Paul Diffenbach | last post by:
Can anyone point me to an open source library of /statically allocated/ data structures? I'm writing some code that would benefit from trees, preferably self balancing, but on an embedded system...
100
by: E. Robert Tisdale | last post by:
What is an object? Where did this term come from? Does it have any relation to the objects in "object oriented programming"?
3
by: Sathyaish | last post by:
I wanted to practice some Linked List stuff, so I set out to create a linked list. The plan was to create the following: (1) A linked list class in Visual Basic (2) A non-class based linked list...
51
by: jacob navia | last post by:
I would like to add at the beginning of the C tutorial I am writing a short blurb about what "types" are. I came up with the following text. Please can you comment? Did I miss something? Is...
21
by: tyler_durden | last post by:
hi there peeps... like I say in the topic, I need to do an e-mail program in C language, and has to be made until the 3th of january..the problem is I'm having some problems with it. I was...
13
by: ranjeet.gupta | last post by:
Dear All What does exactly below code means struct File { void* data; }; typedef struct File File; typedef File* fl;
4
by: pai | last post by:
Hi, Can any body explain me about V-table and Vptr ( virtual pointer ). ANy link is also welcomed. I didnt get useful explation about the topic .I mean some what detail explation . As what...
12
by: Robert.Holic | last post by:
Hi All (first time caller, long time listener), I've stumbled across a problem that I have yet to figure out, although Im sure I'll kick myself when I figure it out. Here it is: I need to...
4
by: grizggg | last post by:
I have searched and not found an answer to this question. I ran upon the following statement in a *.cpp file in a member function: static const char * const pacz_HTMLContentTypeHeader =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.