Given:
class A {
int x, y;
}
class B : A {
int z;
}
B
foo = new
B,
bar = new
B;
scope B
alpha = new
B;
Q1: How do I copy the member
variables contributed by base class A
from "foo" to
"bar"?
In C++: (A
&) bar = foo;
Q2: How do I do a deepcopy of foo to
bar?
In C++: bar
= foo;
Q3: Is the object "alpha" on the
stack (per documentation)?
Q4: What happens when I do "alpha =
foo;"?
"printf( "%p\n",
alpha);" indicates that the address
of "alpha" has changed.
Thanks, Larry