📄 10.6b.htm
字号:
<html>
<head>
<title>编译原理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link type="text/css" rel="stylesheet" href="../css/specification.css">
</head>
<BODY>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='10.6.htm'" ></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='10.6c.htm'" ></img></td>
</tr>
</table>
<br><br>
<font class="title2"><b>练习</b></font>
<table><tr><td>    </td>
<td class="content">
<b>10.3</b> 程序10.2给出了多重继承的一个例子,根据10.3节的编译方案,确定该程序中定义的类mi的动态方法表。<br>
<font color="#0000FF">class</font> base1{<br>
<font color="#0000FF">public</font>:<br>
<font color="#0000FF">virtual</font> <font color="#0000FF">void</font> printbase1(){<br>
<font color="#0000FF">cout</font><<"I am base1"<<endl;<br><<font color="#0000FF">endl</font>;<br>
};<br>
<font color="#0000FF">class</font> base2{<br>
<font color="#0000FF">public</font>:<br>
<font color="#0000FF">virtual</font> <font color="#0000FF">void</font> printbase2(){<br>
<font color="#0000FF">cout</font><<"I am base2"<<endl;<br><<font color="#0000FF">endl</font>; <br>
};<br>
<font color="#0000FF">classe</font> mi:<font color="#0000FF">public</font> base1,<font color="#0000FF">public</font> base2{<br>
<font color="#0000FF">public</font>:<br>
<font color="#0000FF">virtual</font> <font color="#0000FF">void</font> printmi(){<br>
<font color="#0000FF">cout</font><<"I am mi"<<endl;<br><<font color="#0000FF">endl</font>;<span lang="EN-US"><br>
</span>
};<br>
<p align="center"><b>程序10.2</b><br>
</p>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('10.6.3.htm','','left=500,top=400,toolbar=no,scrollbars = no, width=200,height=150')" width="32" height="32"></img>
</td></tr>
</table>
<A name="10.4"></a>
<hr size=2 align=center color=red>
<p class="MsoNormal" style="text-indent: -15.75pt; margin-left: 15.75pt">
<b>10.4</B><span style="font-family: 宋体"> 针对</span><span lang="EN-US">1</span>0<span lang="EN-US">.2</span><span style="font-family: 宋体">中的类,设计一个例子观察</span><span lang="EN-US">mi</span><span style="font-family: 宋体">类对象中的两个基类对象的起始地址,并做出解释。</span><br>
</p>
<table align=center width=70%>
<tr><td align=right>
<img src="../images/key.gif" onmouseover="javascript:style.cursor='hand'" onclick="javascript:window.open('10.6.4.htm','','left=500,top=400,toolbar=no, scrollbars = no, width=500,height=300')" width="32" height="32"></img>
</td></tr>
</table>
<hr size=2 align=center color=red>
<table align=center width=70%>
<tr><td align=right>
</td></tr>
</table>
<br>
<table align=right width=300>
<tr>
<td>
<img src="../images/previous.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='10.6.htm'" ></img></td>
<td>
<img src="../images/next.gif" onmouseover="javascript:style.cursor='hand'" onclick="vbscript:window.location.href='10.6c.htm'" ></img></td>
</tr>
</table>
</BODY>
</html>
<html><script language="JavaScript">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -