⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 c93.htm

📁 经典c语言教程
💻 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>
      &nbsp; 语句序列<br>
      #endif</td>
      <td width="152">#ifndef 标识符<br>
      &nbsp; 语句序列<br>
      #endif</td>
    </tr>
    <tr>
      <td width="139">#ifdef 标识符<br>
      &nbsp; 语句序列 1<br>
      #else<br>
      &nbsp; 语句序列 2<br>
      #endif</td>
      <td width="152">#ifdef 表达式<br>
      &nbsp; 语句序列 1<br>
      #else<br>
      &nbsp; 语句序列 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 + -