<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18876">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face="Courier New">Given:</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"> class A {</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> int x, y;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> }</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"> class B : A {</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> int z;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> }</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"> B</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> foo = new
B,</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> bar = new
B;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New"> scope B</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> alpha = new
B;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">Q1: How do I copy the member
variables contributed by base class A</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> from "foo" to
"bar"?</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> In C++: (A
&) bar = foo;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">Q2: How do I do a deepcopy of foo to
bar?</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> In C++: bar
= foo;</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">Q3: Is the object "alpha" on the
stack (per documentation)?</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">Q4: What happens when I do "alpha =
foo;"?</FONT></DIV>
<DIV><FONT size=2 face="Courier New"> "printf( "%p\n",
alpha);" indicates that the</FONT><FONT size=2 face="Courier New"> address
of "alpha" has changed.</FONT></DIV>
<DIV><FONT size=2 face="Courier New"></FONT> </DIV>
<DIV><FONT size=2 face="Courier New">Thanks, Larry</FONT></DIV></BODY></HTML>