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

vptr

Hi Everyone,

I was wondering what is the datatype of vtpr and what is its access
specifier (public or private or protected)?
This is in regard to the inheritance of a class having one or more
virtual functions.

Thanks in advance!!!

Nov 4 '07 #1
3 2981
Rahul wrote:
:: Hi Everyone,
::
:: I was wondering what is the datatype of vtpr and what is its
:: access specifier (public or private or protected)?
:: This is in regard to the inheritance of a class having one or more
:: virtual functions.
::

It is all implementation specific, so we don't know.

There is not even a requirement to have a vptr, if the compiler can
perform the required actions without one.
Bo Persson
Nov 4 '07 #2
On Nov 4, 3:52 pm, "Bo Persson" <b...@gmb.dkwrote:
Rahul wrote:

:: Hi Everyone,
::
:: I was wondering what is the datatype of vtpr and what is its
:: access specifier (public or private or protected)?
:: This is in regard to the inheritance of a class having one or more
:: virtual functions.
::

It is all implementation specific, so we don't know.

There is not even a requirement to have a vptr, if the compiler can
perform the required actions without one.

Bo Persson

I think as a user there is no need to know the type,

Nov 4 '07 #3
On 2007-11-04 12:45, sr*************@gmail.com wrote:
On Nov 4, 3:52 pm, "Bo Persson" <b...@gmb.dkwrote:
>Rahul wrote:

:: Hi Everyone,
::
:: I was wondering what is the datatype of vtpr and what is its
:: access specifier (public or private or protected)?
:: This is in regard to the inheritance of a class having one or more
:: virtual functions.
::

It is all implementation specific, so we don't know.

There is not even a requirement to have a vptr, if the compiler can
perform the required actions without one.
Please do not quote signatures, and please reply to the post to which
your reply is directed.
I think as a user there is no need to know the type,
I think that as a user there is no way to tell if there is a vptr to
begin with.

--
Erik Wikström
Nov 4 '07 #4

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

Similar topics

11
by: Edd | last post by:
Hello all, I've made a data structure and an associated set of functions to enable me to store a dynamically-sized array of elements of whatever data type I like. Well that's the idea anyway......
7
by: Veeru | last post by:
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
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...
4
by: Subhransu Sahoo | last post by:
Hi All, Can anyone tell me why the output of the following program is fx1 fx2 ? #include <iostream> using namespace std; class IX { public:
5
by: nileshsimaria | last post by:
Hi, A void pointer can point to any object. Compiler doesnt know size of the object being pointed by void pointer thats why ++ is not allowed in void pointer. I have small C programme...
4
by: slamps | last post by:
Hi, i have this code: struct MenuChan { virtual void draw()=0; }; struct MenuData_01 { int nEast; int nNorth;
5
by: viza | last post by:
Hi all, if I have: void *vptr= malloc( ENOUGH ); is this guaranteed to always be true: ( (sometype*)vptr ) + 1 == vptr + sizeof(sometype)
32
by: viza | last post by:
Hi all Is this assertion guaranteed? { void *vptr; memset( & vptr, 0, sizeof vptr); assert( NULL == vptr ); } What about these ones?
23
by: tonytech08 | last post by:
What I like about the C++ object model: that the data portion of the class IS the object (dereferencing an object gets you the data of a POD object). What I don't like about the C++ object...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.