difference between class B and Class C

P

Pallav singh

what is the difference between class B and Class C w.r.t. void func( )
{ }


Class A{
Public :
Virtual void func( ){ }
}

Class B : public A{
Public :
Virtual void func( ){ }
}

Class C : public A{
Public :
void func( ){ }
}
 
A

Alf P. Steinbach

* Pallav singh:
what is the difference between class B and Class C w.r.t. void func( )
{ }


Class A{
Public :
Virtual void func( ){ }
}

Class B : public A{
Public :
Virtual void func( ){ }
}

Class C : public A{
Public :
void func( ){ }
}

This looks like a homework assignment.

Since the code contains numerous typos you haven't tried this.

The best way to proceed is to try it.


Cheers & hth.,

- Alf
 
P

Pallav singh

* Pallav singh:







This looks like a homework assignment.

Since the code contains numerous typos you haven't tried this.

The best way to proceed is to try it.

Cheers & hth.,

- Alf

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+

Is is something related to Sharing / Non-sharing of VTBL ?
 
R

red floyd

Pallav said:
[redacted]
Is is something related to Sharing / Non-sharing of VTBL ?

A vtbl is something you should never be concerned about directly.
It's an implementation detail at best. Since the Standard doesn't
require a vtbl, an implementation is free not to provide one.

As has been mentioned before, I (and others) can imagine implementations
of varying quality which provide no vtbl at all.
 
R

red floyd

red said:
Pallav said:
[redacted]
Is is something related to Sharing / Non-sharing of VTBL ?

A vtbl is something you should never be concerned about directly.
It's an implementation detail at best. Since the Standard doesn't
require a vtbl, an implementation is free not to provide one.

As has been mentioned before, I (and others) can imagine implementations
of varying quality which provide no vtbl at all.

Correction. A vtbl is something you should never be concerned about
directly, unless you are writing a compiler.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top