{"id":100,"date":"2026-09-21T19:18:56","date_gmt":"2026-09-21T11:18:56","guid":{"rendered":"https:\/\/decagrammaton.xyz\/?p=100"},"modified":"2026-09-18T19:21:47","modified_gmt":"2026-09-18T11:21:47","slug":"013-c%e8%af%ad%e8%a8%80%e5%a4%9a%e6%96%87%e4%bb%b6%e7%bc%96%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/decagrammaton.xyz\/?p=100","title":{"rendered":"013-C\u8bed\u8a00\u591a\u6587\u4ef6\u7f16\u7a0b"},"content":{"rendered":"\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u524d\u9762\u5df2\u7ecf\u5b66\u4e60\u4e86\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u7ed3\u6784\u4f53\n\u52a8\u6001\u5185\u5b58\n\u6587\u4ef6\u64cd\u4f5c\n\u9884\u5904\u7406\u4e0e\u5934\u6587\u4ef6<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f53\u7a0b\u5e8f\u8d8a\u6765\u8d8a\u5927\u65f6\uff0c\u5982\u679c\u6240\u6709\u4ee3\u7801\u90fd\u5199\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u91cc\u9762\uff0c\u4f1a\u8d8a\u6765\u8d8a\u96be\u7ef4\u62a4\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\u4e00\u4e2a\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u53ef\u80fd\u6709\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5b66\u751f\u76f8\u5173\u4ee3\u7801\n\u6587\u4ef6\u76f8\u5173\u4ee3\u7801\n\u83dc\u5355\u76f8\u5173\u4ee3\u7801\n\u5de5\u5177\u51fd\u6570\n\u4e3b\u7a0b\u5e8f<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u5168\u90e8\u585e\u8fdb\u4e00\u4e2a\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u80fd\u4f1a\u53d8\u6210\u51e0\u5343\u884c\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u628a\u7a0b\u5e8f\u62c6\u6210\u591a\u4e2a\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nstudent.h\nfile.c\nfile.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u591a\u6587\u4ef6\u7f16\u7a0b\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u4e3a\u4ec0\u4e48\u8981\u4f7f\u7528\u591a\u4e2a\u6587\u4ef6<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\u6211\u4eec\u6709\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb6\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb6-1\"><a href=\"#cb6-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb6-2\"><a href=\"#cb6-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"Hello<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb6-3\"><a href=\"#cb6-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u53ea\u6709\u4e00\u4e2a\u51fd\u6570\u5f53\u7136\u6ca1\u95ee\u9898\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\u5982\u679c\u7a0b\u5e8f\u53d8\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main()\nstudent()\nfile()\nmenu()\nconfig()\nutils()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5168\u90e8\u653e\u5728\u4e00\u4e2a\u6587\u4ef6\u91cc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee3\u7801\u4f1a\u8d8a\u6765\u8d8a\u96be\u627e\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u62c6\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nfile.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u4e2a\u6587\u4ef6\u8d1f\u8d23\u4e00\u90e8\u5206\u529f\u80fd\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n\u2193\n\u7a0b\u5e8f\u5165\u53e3\u3001\u83dc\u5355\n\nstudent.c\n\u2193\n\u5b66\u751f\u76f8\u5173\u64cd\u4f5c\n\nfile.c\n\u2193\n\u6587\u4ef6\u8bfb\u5199<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\u6a21\u5757\u5316\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u3001.c \u548c .h \u5206\u522b\u662f\u4ec0\u4e48<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6587\u4ef6\u7f16\u7a0b\u6700\u91cd\u8981\u7684\u4e24\u4e2a\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.c\n.h<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><code>.c<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u5e38\u7528\u4e8e\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u51fd\u6570\u5b9e\u73b0\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb12\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb12-1\"><a href=\"#cb12-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb12-2\"><a href=\"#cb12-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"Hello<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb12-3\"><a href=\"#cb12-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><code>.h<\/code><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u5e38\u7528\u4e8e\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u58f0\u660e\u548c\u516c\u5171\u5b9a\u4e49\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb13\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb13-1\"><a href=\"#cb13-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u7b80\u5355\u8bb0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.h\n\u2193\n\u544a\u8bc9\u522b\u4eba\u201c\u6709\u4ec0\u4e48\u201d\n\n.c\n\u2193\n\u771f\u6b63\u5b9e\u73b0\u201c\u600e\u4e48\u505a\u201d<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u3001\u58f0\u660e\u4e0e\u5b9a\u4e49<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u6982\u5ff5\u5728\u591a\u6587\u4ef6\u7f16\u7a0b\u4e2d\u975e\u5e38\u91cd\u8981\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb15\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb15-1\"><a href=\"#cb15-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> add<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u58f0\u660e\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u610f\u601d\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6709\u4e00\u4e2a add \u51fd\u6570\n\u5b83\u63a5\u6536\u4e24\u4e2a int\n\u8fd4\u56de\u4e00\u4e2a int<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb17\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb17-1\"><a href=\"#cb17-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> add<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb17-2\"><a href=\"#cb17-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> a <span class=\"op\">+<\/span> b<span class=\"op\">;<\/span><\/span>\n<span id=\"cb17-3\"><a href=\"#cb17-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5b9a\u4e49\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u771f\u6b63\u5b9e\u73b0\u8fd9\u4e2a\u51fd\u6570\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u58f0\u660e\n\u2193\n\u544a\u8bc9\u7f16\u8bd1\u5668\u5b58\u5728\u8fd9\u4e2a\u4e1c\u897f\n\n\u5b9a\u4e49\n\u2193\n\u771f\u6b63\u5b9e\u73b0\u8fd9\u4e2a\u4e1c\u897f<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u56db\u3001\u6700\u7b80\u5355\u7684\u591a\u6587\u4ef6\u7a0b\u5e8f<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5148\u5efa\u7acb\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>project\/\n\u251c\u2500 main.c\n\u251c\u2500 hello.c\n\u2514\u2500 hello.h<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">hello.h<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb20\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb20-1\"><a href=\"#cb20-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef HELLO_H<\/span><\/span>\n<span id=\"cb20-2\"><a href=\"#cb20-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define HELLO_H<\/span><\/span>\n<span id=\"cb20-3\"><a href=\"#cb20-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb20-4\"><a href=\"#cb20-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">();<\/span><\/span>\n<span id=\"cb20-5\"><a href=\"#cb20-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb20-6\"><a href=\"#cb20-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u51fd\u6570\u58f0\u660e<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">hello.c<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb22\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb22-1\"><a href=\"#cb22-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb22-2\"><a href=\"#cb22-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"hello.h\"<\/span><\/span>\n<span id=\"cb22-3\"><a href=\"#cb22-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb22-4\"><a href=\"#cb22-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb22-5\"><a href=\"#cb22-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"Hello World!<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb22-6\"><a href=\"#cb22-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u51fd\u6570\u5b9a\u4e49<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">main.c<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb24\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb24-1\"><a href=\"#cb24-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"hello.h\"<\/span><\/span>\n<span id=\"cb24-2\"><a href=\"#cb24-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb24-3\"><a href=\"#cb24-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb24-4\"><a href=\"#cb24-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    hello<span class=\"op\">();<\/span><\/span>\n<span id=\"cb24-5\"><a href=\"#cb24-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb24-6\"><a href=\"#cb24-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb24-7\"><a href=\"#cb24-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u8c03\u7528\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb25\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb25-1\"><a href=\"#cb25-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e94\u3001\u7f16\u8bd1\u591a\u4e2a .c \u6587\u4ef6<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528 GCC\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb26\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb26-1\"><a href=\"#cb26-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c hello.c <span class=\"at\">-o<\/span> main<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n+\nhello.c\n\u2193\n\u7f16\u8bd1\n\u2193\n\u94fe\u63a5\n\u2193\nmain<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb28\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb28-1\"><a href=\"#cb28-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"ex\">.\/main<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Windows \u4e0b\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb29\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb29-1\"><a href=\"#cb29-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"ex\">main.exe<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Hello World!<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u516d\u3001\u4e3a\u4ec0\u4e48 main.c \u80fd\u8c03\u7528\nhello()<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3a\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb31\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb31-1\"><a href=\"#cb31-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"hello.h\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u9884\u5904\u7406\u540e\uff0c<code>main.c<\/code> \u53ef\u4ee5\u770b\u5230\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb32\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb32-1\"><a href=\"#cb32-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8e\u662f\u7f16\u8bd1\u5668\u77e5\u9053\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello()\n\u5b58\u5728<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u771f\u6b63\u7684\u5b9e\u73b0\u5728\u54ea\u91cc\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u6700\u540e\u9700\u8981\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u94fe\u63a5\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e03\u3001\u7f16\u8bd1\u548c\u94fe\u63a5<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u4e2a <code>.c<\/code> \u6587\u4ef6\u5e76\u4e0d\u662f\u76f4\u63a5\u53d8\u6210\u4e00\u4e2a\u7a0b\u5e8f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u7c97\u7565\u7406\u89e3\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n \u2193\n\u9884\u5904\u7406\n \u2193\n\u7f16\u8bd1\n \u2193\nmain.o\n\nhello.c\n \u2193\n\u9884\u5904\u7406\n \u2193\n\u7f16\u8bd1\n \u2193\nhello.o\n\nmain.o + hello.o\n \u2193\n\u94fe\u63a5\n \u2193\nmain<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u7f16\u8bd1\n\u2193\n\u6bcf\u4e2a .c \u53d8\u6210\u76ee\u6807\u6587\u4ef6\n\n\u94fe\u63a5\n\u2193\n\u628a\u591a\u4e2a\u76ee\u6807\u6587\u4ef6\u7ec4\u5408\u8d77\u6765<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u516b\u3001\u4e3a\u4ec0\u4e48\u53ea\u7f16\u8bd1 main.c\n\u4f1a\u62a5\u9519<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u6267\u884c\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb38\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb38-1\"><a href=\"#cb38-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c <span class=\"at\">-o<\/span> main<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><code>main.c<\/code> \u867d\u7136\u901a\u8fc7\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb39\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb39-1\"><a href=\"#cb39-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"hello.h\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u77e5\u9053\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb40\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb40-1\"><a href=\"#cb40-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f <code>hello()<\/code> \u7684\u5b9e\u73b0\u4e0d\u5728 <code>main.c<\/code>\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u94fe\u63a5\u9636\u6bb5\u4f1a\u627e\u4e0d\u5230\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e8e\u662f\u51fa\u73b0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>undefined reference to `hello`<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Windows + MinGW \u4e0b\u53ef\u80fd\u4f1a\u770b\u5230\u7c7b\u4f3c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>undefined reference to `hello`<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u610f\u601d\u5c31\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u58f0\u660e\u627e\u5230\u4e86\uff0c\u4f46\u5b9e\u73b0\u6ca1\u6709\u94fe\u63a5\u8fdb\u6765\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e5d\u3001\u5934\u6587\u4ef6\u4e0d\u662f\u5b9e\u73b0<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u91cc\u9762\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb45\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb45-1\"><a href=\"#cb45-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u662f\u544a\u8bc9\u7f16\u8bd1\u5668\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6709\u4e00\u4e2a hello()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u771f\u6b63\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb47\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb47-1\"><a href=\"#cb47-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> hello<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb47-2\"><a href=\"#cb47-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"Hello\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb47-3\"><a href=\"#cb47-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5e94\u8be5\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>hello.h\n\u2193\n\u58f0\u660e\n\nhello.c\n\u2193\n\u5b9a\u4e49<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u3001\u7ed3\u6784\u4f53\u4e5f\u53ef\u4ee5\u653e\u8fdb\u5934\u6587\u4ef6<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u5199\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb51\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb51-1\"><a href=\"#cb51-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef STUDENT_H<\/span><\/span>\n<span id=\"cb51-2\"><a href=\"#cb51-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define STUDENT_H<\/span><\/span>\n<span id=\"cb51-3\"><a href=\"#cb51-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb51-4\"><a href=\"#cb51-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">typedef<\/span> <span class=\"kw\">struct<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb51-5\"><a href=\"#cb51-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">char<\/span> name<span class=\"op\">[<\/span><span class=\"dv\">50<\/span><span class=\"op\">];<\/span><\/span>\n<span id=\"cb51-6\"><a href=\"#cb51-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> age<span class=\"op\">;<\/span><\/span>\n<span id=\"cb51-7\"><a href=\"#cb51-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">double<\/span> score<span class=\"op\">;<\/span><\/span>\n<span id=\"cb51-8\"><a href=\"#cb51-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span> Student<span class=\"op\">;<\/span><\/span>\n<span id=\"cb51-9\"><a href=\"#cb51-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb51-10\"><a href=\"#cb51-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> print_student<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">);<\/span><\/span>\n<span id=\"cb51-11\"><a href=\"#cb51-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> add_score<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">,<\/span> <span class=\"dt\">double<\/span> score<span class=\"op\">);<\/span><\/span>\n<span id=\"cb51-12\"><a href=\"#cb51-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb51-13\"><a href=\"#cb51-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8d1f\u8d23\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb53\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb53-1\"><a href=\"#cb53-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb53-2\"><a href=\"#cb53-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span>\n<span id=\"cb53-3\"><a href=\"#cb53-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb53-4\"><a href=\"#cb53-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> print_student<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb53-5\"><a href=\"#cb53-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%s<\/span><span class=\"st\"> <\/span><span class=\"sc\">%d<\/span><span class=\"st\"> <\/span><span class=\"sc\">%.2f\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span><\/span>\n<span id=\"cb53-6\"><a href=\"#cb53-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>           p<span class=\"op\">-&gt;<\/span>name<span class=\"op\">,<\/span><\/span>\n<span id=\"cb53-7\"><a href=\"#cb53-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>           p<span class=\"op\">-&gt;<\/span>age<span class=\"op\">,<\/span><\/span>\n<span id=\"cb53-8\"><a href=\"#cb53-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>           p<span class=\"op\">-&gt;<\/span>score<span class=\"op\">);<\/span><\/span>\n<span id=\"cb53-9\"><a href=\"#cb53-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span>\n<span id=\"cb53-10\"><a href=\"#cb53-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb53-11\"><a href=\"#cb53-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> add_score<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">,<\/span> <span class=\"dt\">double<\/span> score<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb53-12\"><a href=\"#cb53-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">+=<\/span> score<span class=\"op\">;<\/span><\/span>\n<span id=\"cb53-13\"><a href=\"#cb53-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u8d1f\u8d23\u8c03\u7528\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb55\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb55-1\"><a href=\"#cb55-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span>\n<span id=\"cb55-2\"><a href=\"#cb55-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb55-3\"><a href=\"#cb55-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb55-4\"><a href=\"#cb55-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb55-5\"><a href=\"#cb55-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student s <span class=\"op\">=<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb55-6\"><a href=\"#cb55-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"st\">\"Alice\"<\/span><span class=\"op\">,<\/span><\/span>\n<span id=\"cb55-7\"><a href=\"#cb55-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"dv\">18<\/span><span class=\"op\">,<\/span><\/span>\n<span id=\"cb55-8\"><a href=\"#cb55-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"fl\">95.5<\/span><\/span>\n<span id=\"cb55-9\"><a href=\"#cb55-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">};<\/span><\/span>\n<span id=\"cb55-10\"><a href=\"#cb55-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb55-11\"><a href=\"#cb55-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    print_student<span class=\"op\">(&amp;<\/span>s<span class=\"op\">);<\/span><\/span>\n<span id=\"cb55-12\"><a href=\"#cb55-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    add_score<span class=\"op\">(&amp;<\/span>s<span class=\"op\">,<\/span> <span class=\"fl\">2.0<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb55-13\"><a href=\"#cb55-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    print_student<span class=\"op\">(&amp;<\/span>s<span class=\"op\">);<\/span><\/span>\n<span id=\"cb55-14\"><a href=\"#cb55-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb55-15\"><a href=\"#cb55-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb55-16\"><a href=\"#cb55-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e00\u3001\u6a21\u5757\u5316<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\u53ef\u4ee5\u770b\u5230\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.h\n\u2193\nStudent \u7c7b\u578b\n\u51fd\u6570\u58f0\u660e\n\nstudent.c\n\u2193\n\u5b66\u751f\u529f\u80fd\u5b9e\u73b0\n\nmain.c\n\u2193\n\u7a0b\u5e8f\u5165\u53e3<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u79cd\u65b9\u5f0f\u53eb\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u6a21\u5757\u5316\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u540e\u8fd8\u53ef\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>file.h\nfile.c\n\nmenu.h\nmenu.c\n\nutils.h\nutils.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u4e00\u4e2a\u6a21\u5757\u8d1f\u8d23\u81ea\u5df1\u7684\u4e8b\u60c5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e8c\u3001extern<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6587\u4ef6\u7f16\u7a0b\u4e2d\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u5173\u952e\u5b57\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb58\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb58-1\"><a href=\"#cb58-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b83\u7528\u4e8e\u58f0\u660e\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u67d0\u4e2a\u53d8\u91cf\u5728\u5176\u4ed6\u5730\u65b9\u5b9a\u4e49\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb59\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb59-1\"><a href=\"#cb59-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"co\">\/\/ config.h<\/span><\/span>\n<span id=\"cb59-2\"><a href=\"#cb59-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb59-3\"><a href=\"#cb59-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span> <span class=\"dt\">int<\/span> max_students<span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u6ca1\u6709\u771f\u6b63\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>max_students<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u662f\u58f0\u660e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6709\u4e00\u4e2a\u53eb max_students \u7684 int<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e09\u3001extern \u7684\u5b9e\u9645\u4f7f\u7528<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u76ee\u5f55\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>project\/\n\u251c\u2500 main.c\n\u251c\u2500 config.c\n\u2514\u2500 config.h<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">config.h<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb63\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb63-1\"><a href=\"#cb63-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef CONFIG_H<\/span><\/span>\n<span id=\"cb63-2\"><a href=\"#cb63-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define CONFIG_H<\/span><\/span>\n<span id=\"cb63-3\"><a href=\"#cb63-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb63-4\"><a href=\"#cb63-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span> <span class=\"dt\">int<\/span> max_students<span class=\"op\">;<\/span><\/span>\n<span id=\"cb63-5\"><a href=\"#cb63-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb63-6\"><a href=\"#cb63-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">config.c<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb64\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb64-1\"><a href=\"#cb64-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"config.h\"<\/span><\/span>\n<span id=\"cb64-2\"><a href=\"#cb64-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb64-3\"><a href=\"#cb64-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> max_students <span class=\"op\">=<\/span> <span class=\"dv\">100<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb65\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb65-1\"><a href=\"#cb65-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> max_students <span class=\"op\">=<\/span> <span class=\"dv\">100<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u624d\u662f\u771f\u6b63\u7684\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5b9a\u4e49\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">main.c<\/h2>\n\n\n\n<div class=\"sourceCode\" id=\"cb66\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb66-1\"><a href=\"#cb66-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb66-2\"><a href=\"#cb66-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"config.h\"<\/span><\/span>\n<span id=\"cb66-3\"><a href=\"#cb66-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb66-4\"><a href=\"#cb66-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb66-5\"><a href=\"#cb66-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb66-6\"><a href=\"#cb66-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span> max_students<span class=\"op\">);<\/span><\/span>\n<span id=\"cb66-7\"><a href=\"#cb66-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb66-8\"><a href=\"#cb66-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb66-9\"><a href=\"#cb66-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f16\u8bd1\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb67\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb67-1\"><a href=\"#cb67-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c config.c <span class=\"at\">-o<\/span> main<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>100<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u56db\u3001\u4e3a\u4ec0\u4e48 extern \u6709\u7528<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nfile.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u4e2a\u6a21\u5757\u90fd\u9700\u8981\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>max_students<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u628a\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb71\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb71-1\"><a href=\"#cb71-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span> <span class=\"dt\">int<\/span> max_students<span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u653e\u5230\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u5404\u4e2a <code>.c<\/code>\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb73\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb73-1\"><a href=\"#cb73-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"config.h\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5373\u53ef\u4f7f\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u771f\u6b63\u7684\u53d8\u91cf\u5b9a\u4e49\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb74\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb74-1\"><a href=\"#cb74-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> max_students <span class=\"op\">=<\/span> <span class=\"dv\">100<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u822c\u53ea\u653e\u5728\u4e00\u4e2a <code>.c<\/code> \u6587\u4ef6\u91cc\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e94\u3001\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u5b9a\u4e49\u5f88\u591a\u6b21<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb75\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb75-1\"><a href=\"#cb75-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> max_students <span class=\"op\">=<\/span> <span class=\"dv\">100<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u65f6\u51fa\u73b0\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nfile.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\u94fe\u63a5\u65f6\u4f1a\u51fa\u73b0\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u91cd\u590d\u5b9a\u4e49\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u4e3a\u7a0b\u5e8f\u91cc\u51fa\u73b0\u4e86\u591a\u4e2a\u540c\u540d\u5168\u5c40\u53d8\u91cf\u5b9a\u4e49\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b63\u786e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config.h\n\u2193\nextern int max_students;\n\nconfig.c\n\u2193\nint max_students = 100;<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u516d\u3001static<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u53e6\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u5173\u952e\u5b57\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb78\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb78-1\"><a href=\"#cb78-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u591a\u6587\u4ef6\u7f16\u7a0b\u4e2d\uff0c<code>static<\/code>\n\u53ef\u4ee5\u8ba9\u4e00\u4e2a\u5168\u5c40\u51fd\u6570\u6216\u5168\u5c40\u53d8\u91cf\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u53ea\u5728\u5f53\u524d <code>.c<\/code> \u6587\u4ef6\u4e2d\u53ef\u89c1\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb79\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb79-1\"><a href=\"#cb79-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> helper<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb79-2\"><a href=\"#cb79-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><span class=\"st\">\"helper<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb79-3\"><a href=\"#cb79-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\u5176\u4ed6 <code>.c<\/code> \u6587\u4ef6\u4e0d\u80fd\u76f4\u63a5\u8c03\u7528\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb80\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb80-1\"><a href=\"#cb80-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>helper<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e03\u3001\u4e3a\u4ec0\u4e48\u9700\u8981 static<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u91cc\u9762\u6709\u4e00\u4e2a\u5185\u90e8\u8f85\u52a9\u51fd\u6570\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb82\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb82-1\"><a href=\"#cb82-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> check_score<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb82-2\"><a href=\"#cb82-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">...<\/span><\/span>\n<span id=\"cb82-3\"><a href=\"#cb82-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e2a\u51fd\u6570\u53ea\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c \u81ea\u5df1\u5185\u90e8\u4f7f\u7528<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u5e0c\u671b\u5176\u4ed6\u6a21\u5757\u8bbf\u95ee\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90a3\u4e48\u53ef\u4ee5\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb84\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb84-1\"><a href=\"#cb84-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> check_score<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb84-2\"><a href=\"#cb84-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">...<\/span><\/span>\n<span id=\"cb84-3\"><a href=\"#cb84-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\u53ef\u4ee5\u51cf\u5c11\u6a21\u5757\u4e4b\u95f4\u7684\u4f9d\u8d56\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u516b\u3001static \u5168\u5c40\u53d8\u91cf<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb85\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb85-1\"><a href=\"#cb85-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">int<\/span> count <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8868\u793a\u8fd9\u4e2a\u53d8\u91cf\u53ea\u5728\u5f53\u524d <code>.c<\/code> \u6587\u4ef6\u4e2d\u53ef\u89c1\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4ed6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u80fd\u76f4\u63a5\u8bbf\u95ee\u8fd9\u4e2a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>count<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e5f\u662f\u6a21\u5757\u5316\u7684\u91cd\u8981\u624b\u6bb5\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e5d\u3001static \u548c\u666e\u901a\u5168\u5c40\u53d8\u91cf<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u666e\u901a\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb88\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb88-1\"><a href=\"#cb88-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> count <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u88ab\u5176\u4ed6 <code>.c<\/code> \u6587\u4ef6\u901a\u8fc7\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb89\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb89-1\"><a href=\"#cb89-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span> <span class=\"dt\">int<\/span> count<span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5f15\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb90\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb90-1\"><a href=\"#cb90-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">int<\/span> count <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u80fd\u5728\u5f53\u524d\u6587\u4ef6\u4f7f\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u7b80\u5355\u8bb0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u666e\u901a\u5168\u5c40\u53d8\u91cf\n\u2193\n\u53ef\u4ee5\u8de8\u6587\u4ef6\u4f7f\u7528\n\nstatic \u5168\u5c40\u53d8\u91cf\n\u2193\n\u53ea\u5c5e\u4e8e\u5f53\u524d .c \u6587\u4ef6<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u3001static \u51fd\u6570<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u666e\u901a\u51fd\u6570\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb92\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb92-1\"><a href=\"#cb92-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> helper<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb92-2\"><a href=\"#cb92-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7406\u8bba\u4e0a\u53ef\u4ee5\u88ab\u5176\u4ed6\u6587\u4ef6\u8c03\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb93\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb93-1\"><a href=\"#cb93-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> helper<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb93-2\"><a href=\"#cb93-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u5141\u8bb8\u5f53\u524d <code>.c<\/code> \u6587\u4ef6\u4f7f\u7528\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c\n\nstatic void check_age() {\n    ...\n}\n\nvoid add_student() {\n    check_age();\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4ed6\u6587\u4ef6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0d\u80fd\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb96\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb96-1\"><a href=\"#cb96-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>check_age<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e00\u3001\u5934\u6587\u4ef6\u4fdd\u62a4<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6587\u4ef6\u9879\u76ee\u4e2d\u7ecf\u5e38\u4f1a\u51fa\u73b0\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb97\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb97-1\"><a href=\"#cb97-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u4e0d\u540c\u5934\u6587\u4ef6\u53c8\u4e92\u76f8\u5305\u542b\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u56e0\u6b64\u9700\u8981\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb98\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb98-1\"><a href=\"#cb98-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef STUDENT_H<\/span><\/span>\n<span id=\"cb98-2\"><a href=\"#cb98-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define STUDENT_H<\/span><\/span>\n<span id=\"cb98-3\"><a href=\"#cb98-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb98-4\"><a href=\"#cb98-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">...<\/span><\/span>\n<span id=\"cb98-5\"><a href=\"#cb98-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb98-6\"><a href=\"#cb98-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb99\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb99-1\"><a href=\"#cb99-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef STUDENT_H<\/span><\/span>\n<span id=\"cb99-2\"><a href=\"#cb99-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define STUDENT_H<\/span><\/span>\n<span id=\"cb99-3\"><a href=\"#cb99-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb99-4\"><a href=\"#cb99-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">typedef<\/span> <span class=\"kw\">struct<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb99-5\"><a href=\"#cb99-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">char<\/span> name<span class=\"op\">[<\/span><span class=\"dv\">50<\/span><span class=\"op\">];<\/span><\/span>\n<span id=\"cb99-6\"><a href=\"#cb99-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> age<span class=\"op\">;<\/span><\/span>\n<span id=\"cb99-7\"><a href=\"#cb99-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span> Student<span class=\"op\">;<\/span><\/span>\n<span id=\"cb99-8\"><a href=\"#cb99-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb99-9\"><a href=\"#cb99-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Include Guard\u3002<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e8c\u3001\u4e00\u4e2a\u5b8c\u6574\u7684\u5b66\u751f\u7ba1\u7406\u9879\u76ee\u7ed3\u6784<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\u628a\u4e4b\u524d\u5b66\u7684\u6240\u6709\u4e1c\u897f\u7ec4\u5408\u8d77\u6765\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student_manager\/\n\u2502\n\u251c\u2500 main.c\n\u2502\n\u251c\u2500 student.c\n\u251c\u2500 student.h\n\u2502\n\u251c\u2500 file.c\n\u251c\u2500 file.h\n\u2502\n\u2514\u2500 config.h<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e09\u3001student.h<\/h1>\n\n\n\n<div class=\"sourceCode\" id=\"cb101\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb101-1\"><a href=\"#cb101-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef STUDENT_H<\/span><\/span>\n<span id=\"cb101-2\"><a href=\"#cb101-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define STUDENT_H<\/span><\/span>\n<span id=\"cb101-3\"><a href=\"#cb101-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb101-4\"><a href=\"#cb101-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">typedef<\/span> <span class=\"kw\">struct<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb101-5\"><a href=\"#cb101-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">char<\/span> name<span class=\"op\">[<\/span><span class=\"dv\">50<\/span><span class=\"op\">];<\/span><\/span>\n<span id=\"cb101-6\"><a href=\"#cb101-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> age<span class=\"op\">;<\/span><\/span>\n<span id=\"cb101-7\"><a href=\"#cb101-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">double<\/span> score<span class=\"op\">;<\/span><\/span>\n<span id=\"cb101-8\"><a href=\"#cb101-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span> Student<span class=\"op\">;<\/span><\/span>\n<span id=\"cb101-9\"><a href=\"#cb101-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb101-10\"><a href=\"#cb101-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> print_student<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">);<\/span><\/span>\n<span id=\"cb101-11\"><a href=\"#cb101-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> add_score<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">,<\/span> <span class=\"dt\">double<\/span> score<span class=\"op\">);<\/span><\/span>\n<span id=\"cb101-12\"><a href=\"#cb101-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb101-13\"><a href=\"#cb101-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8d1f\u8d23\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Student \u7c7b\u578b\n\u51fd\u6570\u58f0\u660e<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u56db\u3001student.c<\/h1>\n\n\n\n<div class=\"sourceCode\" id=\"cb103\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb103-1\"><a href=\"#cb103-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb103-2\"><a href=\"#cb103-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span>\n<span id=\"cb103-3\"><a href=\"#cb103-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb103-4\"><a href=\"#cb103-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> check_score<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb103-5\"><a href=\"#cb103-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">&lt;<\/span> <span class=\"dv\">0<\/span><span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb103-6\"><a href=\"#cb103-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb103-7\"><a href=\"#cb103-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb103-8\"><a href=\"#cb103-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb103-9\"><a href=\"#cb103-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">&gt;<\/span> <span class=\"dv\">100<\/span><span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb103-10\"><a href=\"#cb103-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">=<\/span> <span class=\"dv\">100<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb103-11\"><a href=\"#cb103-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb103-12\"><a href=\"#cb103-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span>\n<span id=\"cb103-13\"><a href=\"#cb103-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb103-14\"><a href=\"#cb103-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> print_student<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb103-15\"><a href=\"#cb103-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    printf<span class=\"op\">(<\/span><\/span>\n<span id=\"cb103-16\"><a href=\"#cb103-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"st\">\"\u59d3\u540d: <\/span><span class=\"sc\">%s\\n<\/span><span class=\"st\">\"<\/span><\/span>\n<span id=\"cb103-17\"><a href=\"#cb103-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"st\">\"\u5e74\u9f84: <\/span><span class=\"sc\">%d\\n<\/span><span class=\"st\">\"<\/span><\/span>\n<span id=\"cb103-18\"><a href=\"#cb103-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"st\">\"\u6210\u7ee9: <\/span><span class=\"sc\">%.2f\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">,<\/span><\/span>\n<span id=\"cb103-19\"><a href=\"#cb103-19\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        p<span class=\"op\">-&gt;<\/span>name<span class=\"op\">,<\/span><\/span>\n<span id=\"cb103-20\"><a href=\"#cb103-20\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        p<span class=\"op\">-&gt;<\/span>age<span class=\"op\">,<\/span><\/span>\n<span id=\"cb103-21\"><a href=\"#cb103-21\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        p<span class=\"op\">-&gt;<\/span>score<\/span>\n<span id=\"cb103-22\"><a href=\"#cb103-22\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">);<\/span><\/span>\n<span id=\"cb103-23\"><a href=\"#cb103-23\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span>\n<span id=\"cb103-24\"><a href=\"#cb103-24\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb103-25\"><a href=\"#cb103-25\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">void<\/span> add_score<span class=\"op\">(<\/span>Student <span class=\"op\">*<\/span>p<span class=\"op\">,<\/span> <span class=\"dt\">double<\/span> score<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb103-26\"><a href=\"#cb103-26\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    p<span class=\"op\">-&gt;<\/span>score <span class=\"op\">+=<\/span> score<span class=\"op\">;<\/span><\/span>\n<span id=\"cb103-27\"><a href=\"#cb103-27\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb103-28\"><a href=\"#cb103-28\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    check_score<span class=\"op\">(<\/span>p<span class=\"op\">);<\/span><\/span>\n<span id=\"cb103-29\"><a href=\"#cb103-29\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb104\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb104-1\"><a href=\"#cb104-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> check_score<span class=\"op\">(...)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u662f\u5185\u90e8\u51fd\u6570\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ea\u6709\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u81ea\u5df1\u53ef\u4ee5\u4f7f\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e94\u3001file.h<\/h1>\n\n\n\n<div class=\"sourceCode\" id=\"cb106\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb106-1\"><a href=\"#cb106-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#ifndef FILE_H<\/span><\/span>\n<span id=\"cb106-2\"><a href=\"#cb106-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#define FILE_H<\/span><\/span>\n<span id=\"cb106-3\"><a href=\"#cb106-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb106-4\"><a href=\"#cb106-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span>\n<span id=\"cb106-5\"><a href=\"#cb106-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb106-6\"><a href=\"#cb106-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> save_students<span class=\"op\">(<\/span><\/span>\n<span id=\"cb106-7\"><a href=\"#cb106-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">const<\/span> <span class=\"dt\">char<\/span> <span class=\"op\">*<\/span>filename<span class=\"op\">,<\/span><\/span>\n<span id=\"cb106-8\"><a href=\"#cb106-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student <span class=\"op\">*<\/span>students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb106-9\"><a href=\"#cb106-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> count<\/span>\n<span id=\"cb106-10\"><a href=\"#cb106-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">);<\/span><\/span>\n<span id=\"cb106-11\"><a href=\"#cb106-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb106-12\"><a href=\"#cb106-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> load_students<span class=\"op\">(<\/span><\/span>\n<span id=\"cb106-13\"><a href=\"#cb106-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">const<\/span> <span class=\"dt\">char<\/span> <span class=\"op\">*<\/span>filename<span class=\"op\">,<\/span><\/span>\n<span id=\"cb106-14\"><a href=\"#cb106-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student <span class=\"op\">*<\/span>students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb106-15\"><a href=\"#cb106-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> count<\/span>\n<span id=\"cb106-16\"><a href=\"#cb106-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">);<\/span><\/span>\n<span id=\"cb106-17\"><a href=\"#cb106-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb106-18\"><a href=\"#cb106-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#endif<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8d1f\u8d23\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6587\u4ef6\u6a21\u5757\u5bf9\u5916\u63d0\u4f9b\u7684\u51fd\u6570\u58f0\u660e<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u516d\u3001file.c<\/h1>\n\n\n\n<div class=\"sourceCode\" id=\"cb108\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb108-1\"><a href=\"#cb108-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb108-2\"><a href=\"#cb108-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"file.h\"<\/span><\/span>\n<span id=\"cb108-3\"><a href=\"#cb108-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-4\"><a href=\"#cb108-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> save_students<span class=\"op\">(<\/span><\/span>\n<span id=\"cb108-5\"><a href=\"#cb108-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">const<\/span> <span class=\"dt\">char<\/span> <span class=\"op\">*<\/span>filename<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-6\"><a href=\"#cb108-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student <span class=\"op\">*<\/span>students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-7\"><a href=\"#cb108-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> count<\/span>\n<span id=\"cb108-8\"><a href=\"#cb108-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb108-9\"><a href=\"#cb108-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">FILE<\/span> <span class=\"op\">*<\/span>fp <span class=\"op\">=<\/span> fopen<span class=\"op\">(<\/span>filename<span class=\"op\">,<\/span> <span class=\"st\">\"wb\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-10\"><a href=\"#cb108-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-11\"><a href=\"#cb108-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>fp <span class=\"op\">==<\/span> NULL<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb108-12\"><a href=\"#cb108-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb108-13\"><a href=\"#cb108-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb108-14\"><a href=\"#cb108-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-15\"><a href=\"#cb108-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    fwrite<span class=\"op\">(<\/span><\/span>\n<span id=\"cb108-16\"><a href=\"#cb108-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-17\"><a href=\"#cb108-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"kw\">sizeof<\/span><span class=\"op\">(<\/span>Student<span class=\"op\">),<\/span><\/span>\n<span id=\"cb108-18\"><a href=\"#cb108-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        count<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-19\"><a href=\"#cb108-19\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        fp<\/span>\n<span id=\"cb108-20\"><a href=\"#cb108-20\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-21\"><a href=\"#cb108-21\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-22\"><a href=\"#cb108-22\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    fclose<span class=\"op\">(<\/span>fp<span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-23\"><a href=\"#cb108-23\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-24\"><a href=\"#cb108-24\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">1<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb108-25\"><a href=\"#cb108-25\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span>\n<span id=\"cb108-26\"><a href=\"#cb108-26\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-27\"><a href=\"#cb108-27\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> load_students<span class=\"op\">(<\/span><\/span>\n<span id=\"cb108-28\"><a href=\"#cb108-28\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">const<\/span> <span class=\"dt\">char<\/span> <span class=\"op\">*<\/span>filename<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-29\"><a href=\"#cb108-29\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student <span class=\"op\">*<\/span>students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-30\"><a href=\"#cb108-30\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">int<\/span> count<\/span>\n<span id=\"cb108-31\"><a href=\"#cb108-31\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb108-32\"><a href=\"#cb108-32\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"dt\">FILE<\/span> <span class=\"op\">*<\/span>fp <span class=\"op\">=<\/span> fopen<span class=\"op\">(<\/span>filename<span class=\"op\">,<\/span> <span class=\"st\">\"rb\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-33\"><a href=\"#cb108-33\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-34\"><a href=\"#cb108-34\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">if<\/span> <span class=\"op\">(<\/span>fp <span class=\"op\">==<\/span> NULL<span class=\"op\">)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb108-35\"><a href=\"#cb108-35\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb108-36\"><a href=\"#cb108-36\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb108-37\"><a href=\"#cb108-37\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-38\"><a href=\"#cb108-38\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    fread<span class=\"op\">(<\/span><\/span>\n<span id=\"cb108-39\"><a href=\"#cb108-39\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-40\"><a href=\"#cb108-40\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"kw\">sizeof<\/span><span class=\"op\">(<\/span>Student<span class=\"op\">),<\/span><\/span>\n<span id=\"cb108-41\"><a href=\"#cb108-41\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        count<span class=\"op\">,<\/span><\/span>\n<span id=\"cb108-42\"><a href=\"#cb108-42\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        fp<\/span>\n<span id=\"cb108-43\"><a href=\"#cb108-43\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-44\"><a href=\"#cb108-44\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-45\"><a href=\"#cb108-45\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    fclose<span class=\"op\">(<\/span>fp<span class=\"op\">);<\/span><\/span>\n<span id=\"cb108-46\"><a href=\"#cb108-46\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb108-47\"><a href=\"#cb108-47\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">1<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb108-48\"><a href=\"#cb108-48\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u91cc\u628a\u4e0a\u4e00\u7ae0\u5b66\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6587\u4ef6\u64cd\u4f5c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c01\u88c5\u8d77\u6765\u4e86\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e03\u3001main.c<\/h1>\n\n\n\n<div class=\"sourceCode\" id=\"cb110\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb110-1\"><a href=\"#cb110-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">&lt;stdio.h&gt;<\/span><\/span>\n<span id=\"cb110-2\"><a href=\"#cb110-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span>\n<span id=\"cb110-3\"><a href=\"#cb110-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"file.h\"<\/span><\/span>\n<span id=\"cb110-4\"><a href=\"#cb110-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-5\"><a href=\"#cb110-5\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> main<span class=\"op\">()<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb110-6\"><a href=\"#cb110-6\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-7\"><a href=\"#cb110-7\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    Student students<span class=\"op\">[<\/span><span class=\"dv\">2<\/span><span class=\"op\">]<\/span> <span class=\"op\">=<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb110-8\"><a href=\"#cb110-8\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"op\">{<\/span><span class=\"st\">\"Alice\"<\/span><span class=\"op\">,<\/span> <span class=\"dv\">18<\/span><span class=\"op\">,<\/span> <span class=\"fl\">95.5<\/span><span class=\"op\">},<\/span><\/span>\n<span id=\"cb110-9\"><a href=\"#cb110-9\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"op\">{<\/span><span class=\"st\">\"Bob\"<\/span><span class=\"op\">,<\/span> <span class=\"dv\">19<\/span><span class=\"op\">,<\/span> <span class=\"fl\">88.0<\/span><span class=\"op\">}<\/span><\/span>\n<span id=\"cb110-10\"><a href=\"#cb110-10\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">};<\/span><\/span>\n<span id=\"cb110-11\"><a href=\"#cb110-11\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-12\"><a href=\"#cb110-12\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    add_score<span class=\"op\">(&amp;<\/span>students<span class=\"op\">[<\/span><span class=\"dv\">0<\/span><span class=\"op\">],<\/span> <span class=\"fl\">2.0<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb110-13\"><a href=\"#cb110-13\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-14\"><a href=\"#cb110-14\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">for<\/span> <span class=\"op\">(<\/span><span class=\"dt\">int<\/span> i <span class=\"op\">=<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span> i <span class=\"op\">&lt;<\/span> <span class=\"dv\">2<\/span><span class=\"op\">;<\/span> i<span class=\"op\">++)<\/span> <span class=\"op\">{<\/span><\/span>\n<span id=\"cb110-15\"><a href=\"#cb110-15\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        print_student<span class=\"op\">(&amp;<\/span>students<span class=\"op\">[<\/span>i<span class=\"op\">]);<\/span><\/span>\n<span id=\"cb110-16\"><a href=\"#cb110-16\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        printf<span class=\"op\">(<\/span><span class=\"st\">\"<\/span><span class=\"sc\">\\n<\/span><span class=\"st\">\"<\/span><span class=\"op\">);<\/span><\/span>\n<span id=\"cb110-17\"><a href=\"#cb110-17\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">}<\/span><\/span>\n<span id=\"cb110-18\"><a href=\"#cb110-18\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-19\"><a href=\"#cb110-19\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    save_students<span class=\"op\">(<\/span><\/span>\n<span id=\"cb110-20\"><a href=\"#cb110-20\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"st\">\"students.dat\"<\/span><span class=\"op\">,<\/span><\/span>\n<span id=\"cb110-21\"><a href=\"#cb110-21\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        students<span class=\"op\">,<\/span><\/span>\n<span id=\"cb110-22\"><a href=\"#cb110-22\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>        <span class=\"dv\">2<\/span><\/span>\n<span id=\"cb110-23\"><a href=\"#cb110-23\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"op\">);<\/span><\/span>\n<span id=\"cb110-24\"><a href=\"#cb110-24\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><\/span>\n<span id=\"cb110-25\"><a href=\"#cb110-25\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>    <span class=\"cf\">return<\/span> <span class=\"dv\">0<\/span><span class=\"op\">;<\/span><\/span>\n<span id=\"cb110-26\"><a href=\"#cb110-26\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"op\">}<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u516b\u3001\u7f16\u8bd1\u6574\u4e2a\u9879\u76ee<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb111\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb111-1\"><a href=\"#cb111-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c student.c file.c <span class=\"at\">-o<\/span> student_manager<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u7ec8\u5f97\u5230\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student_manager<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Windows\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student_manager.exe<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u5341\u4e5d\u3001\u4e3a\u4ec0\u4e48\u8fd9\u6837\u8bbe\u8ba1<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\u6bcf\u4e2a\u6587\u4ef6\u804c\u8d23\u975e\u5e38\u660e\u786e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n\u2193\n\u7a0b\u5e8f\u5165\u53e3\n\nstudent.h\n\u2193\n\u5b66\u751f\u6a21\u5757\u63a5\u53e3\n\nstudent.c\n\u2193\n\u5b66\u751f\u6a21\u5757\u5b9e\u73b0\n\nfile.h\n\u2193\n\u6587\u4ef6\u6a21\u5757\u63a5\u53e3\n\nfile.c\n\u2193\n\u6587\u4ef6\u6a21\u5757\u5b9e\u73b0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u6837\u4ee5\u540e\u4fee\u6539\u6587\u4ef6\u8bfb\u5199\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u53ea\u9700\u8981\u6539 file.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539\u5b66\u751f\u903b\u8f91\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u53ea\u9700\u8981\u6539 student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3b\u7a0b\u5e8f\u4e0d\u7528\u585e\u6ee1\u6240\u6709\u7ec6\u8282\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u3001\u63a5\u53e3\u548c\u5b9e\u73b0<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6587\u4ef6\u7f16\u7a0b\u53ef\u4ee5\u7406\u89e3\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.h\n\u2193\n\u63a5\u53e3\uff08Interface\uff09\n\n.c\n\u2193\n\u5b9e\u73b0\uff08Implementation\uff09<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb118\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb118-1\"><a href=\"#cb118-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> save_students<span class=\"op\">(...);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u544a\u8bc9\u5916\u754c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u6211\u63d0\u4f9b save_students()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u81f3\u4e8e\u5185\u90e8\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>fopen\nfwrite\nfclose<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u600e\u4e48\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u5916\u90e8\u4e0d\u9700\u8981\u77e5\u9053<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5c31\u662f<strong>\u5c01\u88c5<\/strong>\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u4e00\u3001\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5 include\n.c<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\u6709\u4eba\u53ef\u80fd\u5199\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb122\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb122-1\"><a href=\"#cb122-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.c\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u5e38\u4e0d\u5e94\u8be5\u8fd9\u4e48\u505a\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u63a8\u8350\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb123\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb123-1\"><a href=\"#cb123-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"pp\">#include <\/span><span class=\"im\">\"student.h\"<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u7f16\u8bd1\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb124\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb124-1\"><a href=\"#cb124-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c student.c <span class=\"at\">-o<\/span> main<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u539f\u56e0\u662f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.h\n\u2193\n\u63d0\u4f9b\u63a5\u53e3\n\n.c\n\u2193\n\u5355\u72ec\u7f16\u8bd1\n\n\u94fe\u63a5\u5668\n\u2193\n\u8fde\u63a5\u5b9e\u73b0<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u624d\u662f\u6b63\u5e38\u7684\u591a\u6587\u4ef6\u7f16\u7a0b\u65b9\u5f0f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u4e8c\u3001\u7f16\u8bd1\u8fc7\u7a0b\u518d\u7406\u89e3\u4e00\u6b21<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nstudent.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n\u2193\n\u9884\u5904\u7406\n\u2193\n#include \"student.h\"\n\u2193\n\u5f97\u5230\u9884\u5904\u7406\u540e\u7684 main.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\n\u2193\n\u7f16\u8bd1\n\u2193\nmain.o<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u540c\u65f6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c\n\u2193\n\u9884\u5904\u7406\n\u2193\n\u7f16\u8bd1\n\u2193\nstudent.o<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.o\n+\nstudent.o\n\u2193\n\u94fe\u63a5\n\u2193\n\u53ef\u6267\u884c\u6587\u4ef6<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u4e09\u3001\u53ea\u4fee\u6539\u4e00\u4e2a .c \u6587\u4ef6<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u591a\u6587\u4ef6\u7f16\u7a0b\u8fd8\u6709\u4e00\u4e2a\u5f88\u5927\u7684\u597d\u5904\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5047\u8bbe\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nfile.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u53ea\u4fee\u6539\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7406\u8bba\u4e0a\u4e0d\u9700\u8981\u91cd\u65b0\u5904\u7406\u6240\u6709\u6e90\u7801\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c\n\u2193\n\u91cd\u65b0\u7f16\u8bd1\n\u2193\nstudent.o\n\nmain.o\n\u2193\n\u7ee7\u7eed\u4f7f\u7528\n\nfile.o\n\u2193\n\u7ee7\u7eed\u4f7f\u7528<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u91cd\u65b0\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u94fe\u63a5<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u4e5f\u662f <code>Makefile<\/code> \u540e\u9762\u4f1a\u89e3\u51b3\u7684\u95ee\u9898\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u56db\u3001\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u540e\u9762\u8981\u5b66\nMakefile<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u73b0\u5728\u4f60\u53ef\u80fd\u5199\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb135\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb135-1\"><a href=\"#cb135-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> main.c student.c file.c <span class=\"at\">-o<\/span> main<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u6587\u4ef6\u5c11\u7684\u65f6\u5019\u6ca1\u5173\u7cfb\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u5982\u679c\u53d8\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nstudent.c\nstudent.h\nfile.c\nfile.h\nmenu.c\nmenu.h\nutils.c\nutils.h\nconfig.c\nconfig.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u6bcf\u6b21\u624b\u52a8\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb137\"><pre class=\"sourceCode bash\"><code class=\"sourceCode bash\"><span id=\"cb137-1\"><a href=\"#cb137-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"fu\">gcc<\/span> ...<\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u5c31\u5f88\u9ebb\u70e6\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u591a\u6587\u4ef6\u7f16\u7a0b\n\u2193\nMakefile<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u662f\u975e\u5e38\u81ea\u7136\u7684\u4e0b\u4e00\u6b65\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u5341\u4e94\u3001\u672c\u7ae0\u7ec3\u4e60<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 1<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\nhello.c\nhello.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba9\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb140\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb140-1\"><a href=\"#cb140-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a>hello<span class=\"op\">();<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u4ee5\u6b63\u5e38\u8c03\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 2<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>math.c\nmath.h\nmain.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb142\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb142-1\"><a href=\"#cb142-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> add<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">);<\/span><\/span>\n<span id=\"cb142-2\"><a href=\"#cb142-2\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> sub<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">);<\/span><\/span>\n<span id=\"cb142-3\"><a href=\"#cb142-3\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> mul<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">);<\/span><\/span>\n<span id=\"cb142-4\"><a href=\"#cb142-4\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">int<\/span> div_int<span class=\"op\">(<\/span><span class=\"dt\">int<\/span> a<span class=\"op\">,<\/span> <span class=\"dt\">int<\/span> b<span class=\"op\">);<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 3<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c\nstudent.h\nmain.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u628a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Student\nprint_student\nadd_score<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5168\u90e8\u6a21\u5757\u5316\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 4<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>config.c\nconfig.h\nmain.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f7f\u7528\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb146\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb146-1\"><a href=\"#cb146-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"kw\">extern<\/span> <span class=\"dt\">int<\/span> max_students<span class=\"op\">;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba9 <code>main.c<\/code> \u53ef\u4ee5\u8bbf\u95ee <code>config.c<\/code>\n\u4e2d\u5b9a\u4e49\u7684\u53d8\u91cf\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728 <code>student.c<\/code> \u4e2d\u521b\u5efa\uff1a<\/p>\n\n\n\n<div class=\"sourceCode\" id=\"cb147\"><pre class=\"sourceCode c\"><code class=\"sourceCode c\"><span id=\"cb147-1\"><a href=\"#cb147-1\" aria-hidden=\"true\" tabindex=\"-1\" target=\"_blank\"  rel=\"nofollow\" ><\/a><span class=\"dt\">static<\/span> <span class=\"dt\">void<\/span> check_score<span class=\"op\">(...)<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\u8ba9\u5b83\u53ea\u80fd\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>student.c<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e2d\u4f7f\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u7ec3\u4e60 6<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u628a\u4f60\u4e4b\u524d\u5199\u7684\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8bfe\u7a0b\u8868\u7a0b\u5e8f<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u62c6\u6210\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>main.c\ncourse.c\ncourse.h\nfile.c\nfile.h<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u5176\u4e2d\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>course.c\n\u2193\n\u8bfe\u7a0b\u589e\u5220\u6539\u67e5\n\nfile.c\n\u2193\n\u8bfe\u7a0b\u8868\u4fdd\u5b58\u548c\u8bfb\u53d6\n\nmain.c\n\u2193\n\u83dc\u5355<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\"><\/h1>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u9762\u5df2\u7ecf\u5b66\u4e60\u4e86\uff1a \u5f53\u7a0b\u5e8f\u8d8a\u6765\u8d8a\u5927\u65f6\uff0c\u5982\u679c\u6240\u6709\u4ee3\u7801\u90fd\u5199\u5728\uff1a \u91cc\u9762\uff0c\u4f1a\u8d8a\u6765\u8d8a\u96be\u7ef4\u62a4\u3002 \u4f8b\u5982\u4e00\u4e2a\u5b66\u751f\u7ba1\u7406\u7cfb\u7edf\u53ef\u80fd\u6709\uff1a \u5982\u679c\u5168\u90e8\u585e\u8fdb\u4e00\u4e2a\u6587 &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-100","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/100","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=100"}],"version-history":[{"count":2,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions"}],"predecessor-version":[{"id":105,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=\/wp\/v2\/posts\/100\/revisions\/105"}],"wp:attachment":[{"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=100"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=100"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/decagrammaton.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=100"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}