?? c93.htm
字號:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>條件編譯 </title>
<script language="javascript">
var prePage="http://www.nec.sjtu.edu.cn/support/Course/C/c/c9/c/c9/c92.htm";
var nextPage="c/c9/c94.htm";
function showwin(url,winname,properties){
window.open(url,winname,properties)
}
</script>
<link rel="stylesheet" href="../cstyle.css" type="text/css">
<bgsound src="../voice/c93.au" loop="1">
</head>
<body background="../img/mainback.jpg" bgproperties="fixed">
<h2 align="center"><a name="_top"></a><font face="楷體_GB2312">9.3 條件編譯</font></h2>
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="50%" align="center"><a href="c93.htm#c931.html#c931">條件編譯</a></td>
<td width="50%" align="center"><a href="c93.htm#c932.html#c932">練習題</a></td>
</tr>
</table>
<hr>
<h3><a name="c931"></a>1.條件編譯</h3>
<blockquote>
<p>在這一課里, 我們將學習:</p>
<div align="center"><center><table border="3" width="311" bgcolor="#CCFFFF"
bordercolor="#FF9933" cellspacing="0" cellpadding="0">
<tr>
<td width="139">#ifdef 標識符<br>
語句序列<br>
#endif</td>
<td width="152">#ifndef 標識符<br>
語句序列<br>
#endif</td>
</tr>
<tr>
<td width="139">#ifdef 標識符<br>
語句序列 1<br>
#else<br>
語句序列 2<br>
#endif</td>
<td width="152">#ifdef 表達式<br>
語句序列 1<br>
#else<br>
語句序列 2<br>
#endif</td>
</tr>
</table>
</center></div><p><a
href="javascript:showwin('c93_11.htm',null,'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,copyhistory=0,width=600,height=500')">請看它們的解釋</a>:<img
src="../img/lefthand.gif" alt="lefthand.jpg (983 bytes)" WIDTH="45" HEIGHT="20"></p>
<div align="center"><center><table border="5" width="85%" height="105"
bordercolor="#FF9933" cellspacing="0" cellpadding="0" bgcolor="#CCFFFF">
<tr>
<th width="100%" colspan="4" height="16" bgcolor="#FF9933">主要規則</th>
</tr>
<tr>
<td width="25%" height="77">#if 常量表達式<br>
<br>
檢查常量表達式計算值是否為非 0。</td>
<td width="25%" height="77">#ifdef標識符<br>
<br>
檢查標識符當前是否預定義過。</td>
<td width="25%" height="77">#else<br>
else_語句序列;<br>
#endif <br>
當前表達式為假時, else_語句序列將被編譯。</td>
<td width="25%" height="77">#undef 標識符<br>
如果標識符以前定義過, 那么 #undef 后,
標識符就被編譯器認為是未定義的了。</td>
</tr>
</table>
</center></div><p align="right"><a href="c93.htm#_top.html#_top">返回頁首</a></p>
</blockquote>
<hr>
<h3><a name="c932"></a>2.練習題</h3>
<blockquote>
<p> </p>
<p align="right"><a href="c93.htm#_top.html#_top">返回頁首</a></p>
</blockquote>
<p align="center"><a href="http://www.nec.sjtu.edu.cn/support/Course/C/c/c9/c94.htm"><img src="../img/next.gif" width="145" height="30"
alt="next.gif (3633 bytes)" border="0"></a></p>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -