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

📄 c53.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/c5/c/c5/c52.htm";
   var nextPage="c/c5/c54.htm";
</script>

<link rel="stylesheet" href="../cstyle.css" type="text/css">
<bgsound src="../voice/c53.au" loop="1">
</head>

<body background="../img/mainback.jpg" bgproperties="fixed">

<h2 align="center"><font face="楷体_GB2312"><a name="_top"></a>5.3 结构和数组</font></h2>
<div align="center"><center>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="50%" align="center"><a href="c53.htm#c531.html#c531">结构数组</a></td>
    <td width="50%" align="center"><a href="c53.htm#c532.html#c532">结构中包含数组</a></td>
  </tr>
</table>
</center></div>

<hr>

<h3><a name="c531"></a>1.<font COLOR="#000000">结构数组</font></h3>

<blockquote>
  <table border="0" width="81%">
    <tr>
      <td width="42%">数组元素的类型可以是结构。<br>
      例如:<br>
      struct date birthday[15];<p>给变量赋值:<br>
      birthday[14].day=28;<br>
      birthday[14].month=2;<br>
      birthday[14].year=1939;</td>
      <td width="58%"><img src="../img/c531.gif" alt="c531.jpg (10907 bytes)" WIDTH="311"
      HEIGHT="218"></td>
    </tr>
  </table>
  <p align="right"><a href="c53.htm#_top.html#_top">返回页首</a></p>
</blockquote>

<hr>

<h3><a name="c532"></a>2.<font COLOR="#000000">结构中包含数组</font></h3>

<blockquote>
  <p>结构成员类型也可以是数组</p>
  <p><br>
  例如: <br>
  struct month<br>
  {<br>
  &nbsp;&nbsp;&nbsp; int number_of_days;<br>
  &nbsp;&nbsp;&nbsp; char name[3];<br>
  };</p>
  <p>假设我们已经说明过结构变量 a_month, 然后建立结构a_month 
  如下图所示:&nbsp; </p>
  <p>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
  codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=3,0,0,0" ID="c532"
  WIDTH="420" HEIGHT="140">
    <param name="movie" value="../movie/c532.swf">
    <param name="quality" value="autohigh">
    <param name="bgcolor" value="#FFFFCC">
  </object>
  </p>
  <p align="right"><a href="c53.htm#_top.html#_top">返回页首</a></p>
</blockquote>

<p align="center"><a href="http://www.nec.sjtu.edu.cn/support/Course/C/c/c5/c54.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 + -