+ 1
What is th syntax of multiple inheritance?
syntax
4 ответов
+ 5
just like single imheritance, you only need to add commas and write class names
class A : public B, protected C
0
give upvote to question and help me to unlock my badge please.
0
thank you
0
The general syntax will be like this,
class "classname1" : [access specifier] "classname2" , [access specifier] "classname3"
Here classname1 is the child class who wants to inherit and classname2 and 3 are parent classes who are being inherited.
And access specifier can be public, protected or private.
Note: ignore the quotes and square brackets in the syntax.