Exactly as the question states!
Let's say I have the following snippet
class A
{
int x;
int y;
}
class B : public A
{
int z;
}
class C
{
A a;
public C(A a) : a(a){}
}
What would happen if I called C's constructor with a B class, would it copy it's A part data in the class? Or also keep it's B data somewhere?
Thanks in advance! It might be a stupid question but I never understood actually.