question about syntax in class inheritance

K

Kouisawang

Hey folk,
I found this code from an open project and don't know what it means.
This class seems like inherit from 2 classes but it's possible? what
will the behavior of this class be?

class someAPI : public parentA, public parentB
{
//body
};

thanks
 
M

Michael DOUBEZ

Kouisawang said:
Hey folk,
I found this code from an open project and don't know what it means.
This class seems like inherit from 2 classes but it's possible?

Yes, C++ supports multiple inheritance.
what will the behavior of this class be?

It is likely that the behavior will be the same as any other language
when you implement multiple interfaces and/or extend a class.

C++ doesn't make this distingo which means you can inherit from more
than one implementation; it is up to the designer to make the choice.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top