+ 1
What kind of object is p? Is there a difference in meaning in c# and C++ or the declaration has the same meaning in these lang.?
class parent { \\code } class child : parent { \\code } main function { parent p= new child(); }
1 Respuesta
+ 2
They are different languages and they have different inheritance behavior.
C++ can inherit from multiple
C# can inheritance from only one base Class.
p is a Child type.
https://code.sololearn.com/c1hQM8ieJW8c/?ref=app
This is wht I tried with C++ (I'm not good @ C++)
p is a parent
https://code.sololearn.com/cFGba0Y4878i/?ref=app