{"id":113737,"date":"2026-10-07T10:41:09","date_gmt":"2026-10-07T02:41:09","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/113737.html"},"modified":"2026-10-07T10:41:09","modified_gmt":"2026-10-07T02:41:09","slug":"c%e7%bb%93%e6%9e%84%e4%bd%93%e5%9f%ba%e7%a1%80%ef%bc%88%e4%b8%80%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/113737.html","title":{"rendered":"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09"},"content":{"rendered":"<\/p>\n<h4>C\u7ed3\u6784\u4f53\u57fa\u7840&#xff08;\u4e00&#xff09;<\/h4>\n<ul>\n<li>\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53<\/li>\n<li>\u5efa\u7acb\u7ed3\u6784\u4f53\u7c7b\u578b<\/li>\n<li>\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf<\/li>\n<li>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316<\/li>\n<li>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u7528<\/li>\n<li>\n<ul>\n<li>1. \u5f15\u7528\u6210\u5458\u7684\u57fa\u672c\u65b9\u5f0f<\/li>\n<li>\n<ul>\n<li>\u8865\u5145&#xff1a;\u5b57\u7b26\u6570\u7ec4\u6210\u5458\u4e0d\u80fd\u76f4\u63a5\u8d4b\u503c<\/li>\n<li>\u65b9\u6cd5\u4e00&#xff1a;\u9010\u4e2a\u5b57\u7b26\u590d\u5236<\/li>\n<li>\u65b9\u6cd5\u4e8c&#xff1a;\u4f7f\u7528 strcpy \u51fd\u6570<\/li>\n<\/ul>\n<\/li>\n<li>2. \u6210\u5458\u672c\u8eab\u4e5f\u662f\u7ed3\u6784\u4f53\u65f6\u7684\u5f15\u7528\u65b9\u5f0f<\/li>\n<li>3. \u7ed3\u6784\u4f53\u6210\u5458\u53ef\u4ee5\u53c2\u4e0e\u8fd0\u7b97<\/li>\n<li>4. \u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u53ef\u4ee5\u76f8\u4e92\u8d4b\u503c<\/li>\n<li>5. \u7ed3\u6784\u4f53\u53d8\u91cf\u548c\u6210\u5458\u90fd\u53ef\u4ee5\u53d6\u5730\u5740<\/li>\n<li>6. \u4e24\u79cd\u9519\u8bef\u7528\u6cd5<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53<\/h2>\n<p>\u6570\u7ec4\u53ea\u80fd\u5b58\u50a8\u76f8\u540c\u7c7b\u578b\u7684\u6570\u636e&#xff0c;\u4f46\u5728\u5b9e\u9645\u4f7f\u7528\u4e2d&#xff0c;\u6211\u4eec\u5e38\u5e38\u5e0c\u671b\u6709\u4e00\u79cd\u6570\u636e\u7c7b\u578b&#xff0c;\u53ef\u4ee5\u628a\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u653e\u5728\u4e00\u8d77\u8fdb\u884c\u7ba1\u7406\u3002\u800c\u7ed3\u6784\u4f53\u6b63\u597d\u6ee1\u8db3\u8fd9\u4e2a\u9700\u6c42&#xff0c;\u5b83\u548c\u7c7b\u548c\u5bf9\u8c61\u4e2d\u7684\u7c7b\u975e\u5e38\u50cf&#xff1a;\u6211\u4eec\u53ef\u4ee5\u5148\u8bbe\u5b9a\u4e00\u4e2a\u7ed3\u6784\u7c7b\u578b&#xff0c;\u5728\u5176\u4e2d\u81ea\u5b9a\u4e49\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\u53d8\u91cf\u3002\u7ed3\u6784\u4f53\u53d8\u91cf\u521b\u5efa\u4e4b\u540e&#xff0c;\u5c31\u53ef\u4ee5\u4f7f\u7528\u7ed3\u6784\u4f53\u53d8\u91cf\u8c03\u7528\u5176\u4e2d\u7684\u6570\u636e\u53d8\u91cf\u8fdb\u884c\u8d4b\u503c\u7b49\u64cd\u4f5c\u3002<\/p>\n<h2>\u5efa\u7acb\u7ed3\u6784\u4f53\u7c7b\u578b<\/h2>\n<p>\u683c\u5f0f&#xff1a;<\/p>\n<p><span class=\"token keyword\">struct<\/span> \u7ed3\u6784\u4f53\u540d<span class=\"token punctuation\">{<\/span><br \/>\n\u6210\u5458\u8868\u5217<br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8bf4\u660e&#xff1a;<\/p>\n<li>\u7ed3\u6784\u4f53\u540d\u7531\u7528\u6237\u81ea\u884c\u5b9a\u4e49<\/li>\n<li>struct\u4e0d\u80fd\u7701\u7565<\/li>\n<li>\u7ed3\u6784\u4f53\u53ef\u4ee5\u8bbe\u8ba1\u591a\u4e2a<\/li>\n<li>\u6210\u5458\u53ef\u4ee5\u540c\u65f6\u5c5e\u4e8e\u4e0d\u540c\u7684\u7ed3\u6784\u4f53<\/li>\n<p>\u4e0b\u9762\u4ee5 Student \u4e0e Teacher \u4e24\u4e2a\u7ed3\u6784\u4f53\u7684\u5b9a\u4e49\u4e3a\u4f8b\u5b50&#xff1a;<\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">20<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> age<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">float<\/span> score<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Teacher<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">20<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">char<\/span> course<span class=\"token punctuation\">[<\/span><span class=\"token number\">30<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">float<\/span> salary<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<h2>\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf<\/h2>\n<p>\u8fd9\u91cc\u518d\u7b80\u5355\u8bf4\u4e00\u4e0b&#xff1a;\u7ed3\u6784\u4f53\u7c7b\u578b\u548c int\u3001float \u4e00\u6837&#xff0c;\u90fd\u662f\u4e00\u79cd\u6570\u636e\u7c7b\u578b\u3002\u4e0d\u540c\u7684\u662f&#xff0c;int\u3001float \u8fd9\u7c7b\u7c7b\u578b\u662f\u7531\u7cfb\u7edf\u9884\u5148\u5b9a\u4e49\u597d\u7684&#xff0c;\u800c\u7ed3\u6784\u4f53\u7c7b\u578b\u5219\u662f\u7531\u7528\u6237\u6839\u636e\u5b9e\u9645\u9700\u6c42\u81ea\u884c\u6307\u5b9a\u7684\u3002\u56e0\u6b64&#xff0c;\u5b9a\u4e49\u4e00\u4e2a\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf&#xff0c;\u548c\u5b9a\u4e49\u4e00\u4e2a int \u7c7b\u578b\u53d8\u91cf\u5728\u8bed\u6cd5\u4e0a\u975e\u5e38\u76f8\u4f3c\u3002<\/p>\n<p>\u7c7b\u6bd4&#xff1a;<\/p>\n<p><span class=\"token keyword\">int<\/span> a<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">float<\/span> b<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> student1<span class=\"token punctuation\">,<\/span> student2<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5728\u4e0a\u9762\u7684\u58f0\u660e\u4e2d&#xff0c;struct Student \u662f\u7ed3\u6784\u4f53\u7c7b\u578b\u540d&#xff0c;\u4f5c\u7528\u7c7b\u4f3c\u4e8e int a; \u4e2d\u7684 int&#xff1b;student1 \u548c student2 \u5219\u662f\u7ed3\u6784\u4f53\u53d8\u91cf\u540d&#xff0c;\u4f5c\u7528\u7c7b\u4f3c\u4e8e int a; \u4e2d\u7684 a\u3002<\/p>\n<p>\u5f53\u7136&#xff0c;\u4e5f\u53ef\u4ee5\u5728\u58f0\u660e\u7ed3\u6784\u4f53\u7c7b\u578b\u7684\u540c\u65f6\u5b9a\u4e49\u53d8\u91cf&#xff1a;<\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">20<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> age<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">float<\/span> score<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span>student1<span class=\"token punctuation\">,<\/span> student2<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u4f46\u901a\u5e38\u5e76\u4e0d\u63a8\u8350\u8fd9\u6837\u5199\u3002\u56e0\u4e3a\u8fd9\u79cd\u5199\u6cd5\u628a\u300c\u7ed3\u6784\u4f53\u7c7b\u578b\u7684\u5b9a\u4e49\u300d\u548c\u300c\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5b9a\u4e49\u300d\u7cc5\u5408\u5728\u4e86\u4e00\u8d77&#xff0c;\u4ee3\u7801\u53d8\u957f\u540e\u4e0d\u5bb9\u6613\u533a\u5206\u54ea\u4e9b\u662f\u7c7b\u578b\u3001\u54ea\u4e9b\u662f\u53d8\u91cf&#xff1b;\u540c\u65f6&#xff0c;\u5982\u679c\u540e\u7eed\u8fd8\u60f3\u7ee7\u7eed\u4f7f\u7528 Student \u8fd9\u4e2a\u7ed3\u6784\u4f53\u7c7b\u578b&#xff0c;\u4e5f\u4e0d\u591f\u7075\u6d3b\u3002\u66f4\u63a8\u8350\u7684\u505a\u6cd5\u4ecd\u7136\u662f&#xff1a;\u5148\u5355\u72ec\u5b9a\u4e49\u597d\u7ed3\u6784\u4f53\u7c7b\u578b&#xff0c;\u518d\u6309\u9700\u50cf int a; \u4e00\u6837\u53bb\u5b9a\u4e49\u53d8\u91cf\u3002<\/p>\n<h2>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316<\/h2>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316&#xff0c;\u901a\u5e38\u662f\u5728\u5b9a\u4e49\u7ed3\u6784\u4f53\u53d8\u91cf\u65f6\u8fdb\u884c\u7684\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u5148\u5b9a\u4e49\u597d Student \u7ed3\u6784\u4f53\u7c7b\u578b&#xff0c;\u518d\u5728\u5b9a\u4e49\u53d8\u91cf\u65f6\u8d4b\u503c&#xff1a;<\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> <span class=\"token punctuation\">{<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">20<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">int<\/span> age<span class=\"token punctuation\">;<\/span><br \/>\n    <span class=\"token keyword\">float<\/span> score<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span> student <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token number\">20260101<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u5f20\u4e09&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">18<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">125.5<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u4e5f\u53ef\u4ee5\u5728\u4e3b\u51fd\u6570\u4e2d\u8fd9\u6837\u521d\u59cb\u5316&#xff1a;<\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> student <span class=\"token operator\">&#061;<\/span> <span class=\"token punctuation\">{<\/span><span class=\"token punctuation\">.<\/span>name <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u5f20\u4e09&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token punctuation\">.<\/span>score <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">125.5<\/span><span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u91cc\u4f7f\u7528\u7684\u662f\u6307\u5b9a\u521d\u59cb\u5316&#xff0c;.name \u8868\u793a\u7ed9\u7ed3\u6784\u4f53\u53d8\u91cf student \u4e2d\u7684 name \u6210\u5458\u8d4b\u503c&#xff0c;.score \u8868\u793a\u7ed9 score \u6210\u5458\u8d4b\u503c\u3002\u6307\u5b9a\u521d\u59cb\u5316\u65f6\u53ef\u4ee5\u4e0d\u6309\u6210\u5458\u987a\u5e8f\u4e66\u5199&#xff0c;\u4e5f\u53ef\u4ee5\u53ea\u521d\u59cb\u5316\u90e8\u5206\u6210\u5458\u3002<\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u5982\u679c\u53ea\u521d\u59cb\u5316\u4e86\u90e8\u5206\u6210\u5458&#xff0c;\u90a3\u4e48\u672a\u88ab\u521d\u59cb\u5316\u7684\u6210\u5458\u4f1a\u81ea\u52a8\u88ab\u521d\u59cb\u5316\u4e3a\u96f6\u503c&#xff1a;\u6570\u503c\u578b\u6210\u5458\u4e3a 0&#xff0c;\u5b57\u7b26\u578b\u6210\u5458\u4e3a &#039;\\\\0&#039;&#xff0c;\u6307\u9488\u578b\u6210\u5458\u4e3a NULL\u3002<\/p>\n<h2>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u7528<\/h2>\n<p>\u5b9a\u4e49\u7ed3\u6784\u4f53\u53d8\u91cf\u4e4b\u540e&#xff0c;\u5c31\u53ef\u4ee5\u4f7f\u7528\u7ed3\u6784\u4f53\u53d8\u91cf\u6765\u5f15\u7528\u5176\u4e2d\u7684\u6210\u5458\u3002<\/p>\n<h3>1. \u5f15\u7528\u6210\u5458\u7684\u57fa\u672c\u65b9\u5f0f<\/h3>\n<p>\u5f15\u7528\u7ed3\u6784\u4f53\u53d8\u91cf\u4e2d\u67d0\u4e2a\u6210\u5458\u7684\u65b9\u5f0f\u4e3a&#xff1a;<\/p>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u540d<span class=\"token punctuation\">.<\/span>\u6210\u5458\u540d<\/p>\n<p>\u4f8b\u5982&#xff0c;\u7ed9\u7ed3\u6784\u4f53\u53d8\u91cf student \u4e2d\u7684 id \u6210\u5458\u8d4b\u503c&#xff1a;<\/p>\n<p>student<span class=\"token punctuation\">.<\/span>id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20260101<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u91cc\u7684 . \u79f0\u4e3a\u6210\u5458\u8fd0\u7b97\u7b26&#xff0c;student.id \u5c31\u8868\u793a student \u8fd9\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u4e2d\u7684 id \u6210\u5458\u3002\u8fd9\u53e5\u8bdd\u7684\u4f5c\u7528\u5c31\u662f\u628a 20260101 \u8d4b\u7ed9 student \u7684 id \u6210\u5458\u3002<\/p>\n<h4>\u8865\u5145&#xff1a;\u5b57\u7b26\u6570\u7ec4\u6210\u5458\u4e0d\u80fd\u76f4\u63a5\u8d4b\u503c<\/h4>\n<p>\u8bd5\u8fd0\u884c\u4e0b\u9762\u7684\u4ee3\u7801&#xff0c;\u4f60\u4f1a\u53d1\u73b0\u7f16\u8bd1\u5668\u62a5\u51fa\u9519\u8bef&#xff1a;<\/p>\n<p>[\u9519\u8bef] assignment to expression with array type<\/p>\n<p>\u8fd9\u662f\u56e0\u4e3a\u6211\u4eec\u4e4b\u524d\u8bb2\u8fc7&#xff0c;\u5b57\u7b26\u4e32\u5728 C \u8bed\u8a00\u4e2d\u672c\u8d28\u4e0a\u5c31\u662f\u4e00\u4e2a\u5b57\u7b26\u6570\u7ec4&#xff0c;\u800c\u6570\u7ec4\u540d\u8868\u793a\u6570\u7ec4\u7684\u9996\u5730\u5740&#xff0c;\u662f\u4e00\u4e2a\u5730\u5740\u5e38\u91cf&#xff0c;\u4e0d\u80fd\u653e\u5728\u8d4b\u503c\u53f7\u5de6\u8fb9\u3002\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u6570\u7ec4\u4e4b\u95f4\u4e0d\u80fd\u76f4\u63a5\u76f8\u4e92\u8d4b\u503c\u3002<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> stu<span class=\"token punctuation\">;<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>name <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u5f20\u4e09&#034;<\/span><span class=\"token punctuation\">;<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20260101<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u59d3\u540d&#xff1a;%s&#xff0c;\u5b66\u53f7&#xff1a;%d&#034;<\/span><span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e0a\u9762\u4ee3\u7801\u4e2d&#xff0c;stu.name \u662f\u4e00\u4e2a\u5b57\u7b26\u6570\u7ec4&#xff0c;&#034;\u5f20\u4e09&#034; \u662f\u4e00\u4e2a\u5b57\u7b26\u4e32&#xff0c;stu.name &#061; &#034;\u5f20\u4e09&#034;; \u76f8\u5f53\u4e8e\u8bd5\u56fe\u628a\u4e00\u4e2a\u5b57\u7b26\u4e32\u8d4b\u7ed9\u4e00\u4e2a\u6570\u7ec4\u540d&#xff0c;\u56e0\u6b64\u4f1a\u62a5\u9519\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u6211\u4eec\u6709\u4e24\u79cd\u529e\u6cd5\u3002<\/p>\n<h4>\u65b9\u6cd5\u4e00&#xff1a;\u9010\u4e2a\u5b57\u7b26\u590d\u5236<\/h4>\n<p>\u65e2\u7136\u6570\u7ec4\u4e0d\u80fd\u6574\u4f53\u8d4b\u503c&#xff0c;\u4f46\u6570\u7ec4\u4e2d\u7684\u5355\u4e2a\u5143\u7d20\u662f\u53ef\u4ee5\u8d4b\u503c\u7684&#xff0c;\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5faa\u73af&#xff0c;\u628a\u5b57\u7b26\u4e32\u4e2d\u7684\u5b57\u7b26\u4e00\u4e2a\u4e00\u4e2a\u590d\u5236\u5230 stu.name \u4e2d\u3002<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> stu<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">char<\/span> Name<span class=\"token punctuation\">[<\/span><span class=\"token number\">10<\/span><span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token string\">&#034;\u5f20\u4e09&#034;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">10<\/span><span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> Name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20260101<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u59d3\u540d&#xff1a;%s&#xff0c;\u5b66\u53f7&#xff1a;%d&#034;<\/span><span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u4e0d\u8fc7\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff0c;\u8fd9\u79cd\u65b9\u6cd5\u4e5f\u5bb9\u6613\u5199\u51fa\u95ee\u9898\u3002\u6bd4\u5982&#xff1a;<\/p>\n<p><span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> i <span class=\"token operator\">&lt;<\/span> <span class=\"token number\">2<\/span><span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> Name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>\u5982\u679c\u628a\u5faa\u73af\u6761\u4ef6\u4e2d\u7684 i &lt; 10 \u6539\u6210\u4e86 i &lt; 2&#xff0c;\u6700\u540e\u8f93\u51fa\u7684\u59d3\u540d\u5c31\u53ea\u6709\u201c\u5f20\u201d\u3002\u8fd9\u662f\u56e0\u4e3a\u524d\u9762\u8bf4\u8fc7&#xff0c;\u5b57\u7b26\u4e32\u4e2d\u4f1a\u6709\u4e00\u4e2a\u7ed3\u675f\u6807\u5fd7 &#039;\\\\0&#039;&#xff1a;&#034;\u5f20\u4e09&#034; \u5728\u5185\u5b58\u4e2d\u5b9e\u9645\u5b58\u653e\u7684\u662f &#039;\u5f20&#039;\u3001&#039;\u4e09&#039;\u3001&#039;\\\\0&#039; \u4e09\u4e2a\u5b57\u7b26\u3002\u4e0a\u9762\u7684\u5faa\u73af\u53ea\u590d\u5236\u4e86\u524d\u4e24\u4e2a\u5b57\u7b26&#xff0c;\u6ca1\u6709\u628a &#039;\\\\0&#039; \u590d\u5236\u5230 stu.name \u4e2d&#xff0c;printf \u8f93\u51fa\u65f6\u627e\u4e0d\u5230\u7ed3\u675f\u6807\u5fd7&#xff0c;\u5c31\u4f1a\u7ee7\u7eed\u5411\u540e\u8bfb\u53d6&#xff0c;\u6240\u4ee5\u8f93\u51fa\u7ed3\u679c\u4f1a\u51fa\u9519\u3002<\/p>\n<p>\u5982\u679c\u4e0d\u77e5\u9053\u5b57\u7b26\u6570\u7ec4\u7684\u957f\u5ea6&#xff0c;\u53ef\u4ee5\u7528\u4e0b\u9762\u8fd9\u4e2a\u65b9\u6cd5&#xff0c;\u501f\u52a9\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u6807\u5fd7 &#039;\\\\0&#039; \u6765\u63a7\u5236\u5faa\u73af&#xff1a;<\/p>\n<p><span class=\"token keyword\">for<\/span> <span class=\"token punctuation\">(<\/span><span class=\"token keyword\">int<\/span> i <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span> Name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">!&#061;<\/span> <span class=\"token char\">&#039;\\\\0&#039;<\/span><span class=\"token punctuation\">;<\/span> i<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> Name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">[<\/span>i<span class=\"token punctuation\">]<\/span> <span class=\"token operator\">&#061;<\/span> <span class=\"token char\">&#039;\\\\0&#039;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u6837\u5f53\u9047\u5230 &#039;\\\\0&#039; \u65f6\u5faa\u73af\u7ed3\u675f&#xff0c;\u5c31\u4e0d\u5fc5\u63d0\u524d\u77e5\u9053\u6570\u7ec4\u957f\u5ea6\u3002\u4e0d\u8fc7\u8981\u8bb0\u5f97\u5728\u5faa\u73af\u7ed3\u675f\u540e&#xff0c;\u518d\u7ed9\u76ee\u6807\u5b57\u7b26\u4e32\u8865\u4e0a\u4e00\u4e2a &#039;\\\\0&#039;&#xff0c;\u4fdd\u8bc1 stu.name \u662f\u4e00\u4e2a\u5b8c\u6574\u7684\u5b57\u7b26\u4e32\u3002<\/p>\n<h4>\u65b9\u6cd5\u4e8c&#xff1a;\u4f7f\u7528 strcpy \u51fd\u6570<\/h4>\n<p>\u9010\u4e2a\u5b57\u7b26\u590d\u5236\u867d\u7136\u53ef\u4ee5\u89e3\u51b3\u95ee\u9898&#xff0c;\u4f46\u5199\u8d77\u6765\u6bd4\u8f83\u9ebb\u70e6&#xff0c;\u800c\u4e14\u5bb9\u6613\u6f0f\u6389 &#039;\\\\0&#039;\u3002C \u8bed\u8a00\u6807\u51c6\u5e93\u63d0\u4f9b\u4e86\u4e13\u95e8\u7528\u4e8e\u5b57\u7b26\u4e32\u590d\u5236\u7684\u51fd\u6570 strcpy&#xff0c;\u4f7f\u7528\u65f6\u9700\u8981\u5305\u542b\u5934\u6587\u4ef6 &lt;string.h&gt;\u3002<\/p>\n<p><span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;stdio.h&gt;<\/span><\/span><br \/>\n<span class=\"token macro property\"><span class=\"token directive-hash\">#<\/span><span class=\"token directive keyword\">include<\/span> <span class=\"token string\">&lt;string.h&gt;<\/span><\/span><\/p>\n<p><span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">char<\/span> name<span class=\"token punctuation\">[<\/span><span class=\"token number\">50<\/span><span class=\"token punctuation\">]<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token keyword\">int<\/span> id<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">int<\/span> <span class=\"token function\">main<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">{<\/span><br \/>\n<span class=\"token keyword\">struct<\/span> <span class=\"token class-name\">Student<\/span> stu<span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token function\">strcpy<\/span><span class=\"token punctuation\">(<\/span>stu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">,<\/span> <span class=\"token string\">&#034;\u5f20\u4e09&#034;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><br \/>\nstu<span class=\"token punctuation\">.<\/span>id <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">20260101<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;\u59d3\u540d&#xff1a;%s&#xff0c;\u5b66\u53f7&#xff1a;%d&#034;<\/span><span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">,<\/span> stu<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p><span class=\"token keyword\">return<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token punctuation\">}<\/span><\/p>\n<p>strcpy(stu.name, &#034;\u5f20\u4e09&#034;); \u8868\u793a\u628a\u5b57\u7b26\u4e32 &#034;\u5f20\u4e09&#034; \u590d\u5236\u5230\u5b57\u7b26\u6570\u7ec4 stu.name \u4e2d\u3002strcpy \u4f1a\u81ea\u52a8\u628a\u5b57\u7b26\u4e32\u672b\u5c3e\u7684 &#039;\\\\0&#039; \u4e00\u8d77\u590d\u5236\u8fc7\u53bb&#xff0c;\u56e0\u6b64\u6bd4\u624b\u52a8\u9010\u4e2a\u5b57\u7b26\u590d\u5236\u66f4\u5b89\u5168\u3001\u66f4\u65b9\u4fbf\u3002\u4f7f\u7528 strcpy \u65f6\u8981\u6ce8\u610f&#xff1a;\u76ee\u6807\u6570\u7ec4 stu.name \u5fc5\u987b\u6709\u8db3\u591f\u7684\u7a7a\u95f4\u5b58\u653e\u6e90\u5b57\u7b26\u4e32\u4ee5\u53ca\u6700\u540e\u7684 &#039;\\\\0&#039;\u3002<\/p>\n<h3>2. \u6210\u5458\u672c\u8eab\u4e5f\u662f\u7ed3\u6784\u4f53\u65f6\u7684\u5f15\u7528\u65b9\u5f0f<\/h3>\n<p>\u5982\u679c\u7ed3\u6784\u4f53\u7684\u67d0\u4e2a\u6210\u5458\u672c\u8eab\u4e5f\u662f\u4e00\u4e2a\u7ed3\u6784\u4f53&#xff0c;\u90a3\u4e48\u5f15\u7528\u65f6\u5c31\u9700\u8981\u4e00\u5c42\u4e00\u5c42\u5730\u4f7f\u7528 . \u8fd0\u7b97\u7b26\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u5b66\u751f\u7ed3\u6784\u4f53\u4e2d\u5305\u542b\u4e00\u4e2a\u8868\u793a\u6210\u7ee9\u7684\u7ed3\u6784\u4f53\u6210\u5458 scores&#xff1a;<\/p>\n<p>student<span class=\"token punctuation\">.<\/span>scores<span class=\"token punctuation\">.<\/span>PE <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">85<\/span><span class=\"token punctuation\">;<\/span><br \/>\nstudent<span class=\"token punctuation\">.<\/span>scores<span class=\"token punctuation\">.<\/span>Math <span class=\"token operator\">&#061;<\/span> <span class=\"token number\">120<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u4e0a\u9762\u5148\u901a\u8fc7 student.scores \u627e\u5230 student \u4e2d\u7684 scores \u6210\u5458&#xff0c;\u518d\u901a\u8fc7 .PE\u3001.Math \u7ee7\u7eed\u5f15\u7528 scores \u5185\u90e8\u7684\u6210\u5458\u3002<\/p>\n<h3>3. \u7ed3\u6784\u4f53\u6210\u5458\u53ef\u4ee5\u53c2\u4e0e\u8fd0\u7b97<\/h3>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u4e2d\u7684\u6210\u5458\u53ef\u4ee5\u50cf\u666e\u901a\u53d8\u91cf\u4e00\u6837&#xff0c;\u6839\u636e\u5b83\u81ea\u8eab\u7684\u6570\u636e\u7c7b\u578b\u8fdb\u884c\u5404\u79cd\u8fd0\u7b97\u3002<\/p>\n<p>\u4f8b\u5982&#xff0c;\u5bf9 score \u8fd9\u6837\u7684 float \u7c7b\u578b\u6210\u5458\u8fdb\u884c\u52a0\u6cd5\u8fd0\u7b97&#xff1a;<\/p>\n<p>student<span class=\"token punctuation\">.<\/span>score <span class=\"token operator\">&#061;<\/span> student<span class=\"token punctuation\">.<\/span>score <span class=\"token operator\">&#043;<\/span> <span class=\"token number\">10.5<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u5bf9 age \u8fd9\u6837\u7684 int \u7c7b\u578b\u6210\u5458\u8fdb\u884c\u81ea\u589e\u8fd0\u7b97&#xff1a;<\/p>\n<p>student<span class=\"token punctuation\">.<\/span>age<span class=\"token operator\">&#043;&#043;<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u91cc\u8981\u987a\u4fbf\u8bf4\u660e\u4e00\u4e0b&#xff1a;\u6210\u5458\u8fd0\u7b97\u7b26 . \u7684\u4f18\u5148\u7ea7\u5f88\u9ad8&#xff0c;\u5b83\u548c\u5706\u62ec\u53f7\u3001\u4e0b\u6807\u7b49\u8fd0\u7b97\u7b26\u540c\u5c5e\u4e8e\u6700\u9ad8\u4f18\u5148\u7ea7&#xff0c;\u56e0\u6b64\u8ba1\u7b97\u65f6\u4f1a\u4f18\u5148\u5b8c\u6210\u6210\u5458\u5f15\u7528&#xff0c;\u518d\u8fdb\u884c\u5176\u4ed6\u8fd0\u7b97\u3002<\/p>\n<h3>4. \u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u53ef\u4ee5\u76f8\u4e92\u8d4b\u503c<\/h3>\n<p>C \u8bed\u8a00\u5141\u8bb8\u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u4e4b\u95f4\u76f4\u63a5\u6574\u4f53\u8d4b\u503c\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p>student1 <span class=\"token operator\">&#061;<\/span> student2<span class=\"token punctuation\">;<\/span><\/p>\n<p>\u8fd9\u53e5\u8bdd\u8868\u793a\u628a\u7ed3\u6784\u4f53\u53d8\u91cf student2 \u4e2d\u6240\u6709\u6210\u5458\u7684\u503c&#xff0c;\u4f9d\u6b21\u8d4b\u7ed9\u7ed3\u6784\u4f53\u53d8\u91cf student1 \u4e2d\u5bf9\u5e94\u7684\u6210\u5458\u3002<\/p>\n<h3>5. \u7ed3\u6784\u4f53\u53d8\u91cf\u548c\u6210\u5458\u90fd\u53ef\u4ee5\u53d6\u5730\u5740<\/h3>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u672c\u8eab\u53ef\u4ee5\u53d6\u5730\u5740&#xff0c;\u5b83\u7684\u6210\u5458\u4e5f\u53ef\u4ee5\u53d6\u5730\u5740\u3002<\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token operator\">&amp;<\/span>student<span class=\"token punctuation\">;<\/span><br \/>\n<span class=\"token operator\">&amp;<\/span>student<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">;<\/span><\/p>\n<p>&amp;student \u8868\u793a\u6574\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5730\u5740&#xff0c;&amp;student.id \u8868\u793a\u5176\u4e2d id \u6210\u5458\u7684\u5730\u5740\u3002<\/p>\n<h3>6. \u4e24\u79cd\u9519\u8bef\u7528\u6cd5<\/h3>\n<p>\u4e0d\u80fd\u628a\u6574\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u5f53\u4f5c\u4e00\u4e2a\u6574\u4f53\u76f4\u63a5\u8f93\u51fa\u3002\u4e0b\u9762\u7684\u5199\u6cd5\u662f\u9519\u8bef\u7684&#xff1a;<\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;%s\\\\n&#034;<\/span><span class=\"token punctuation\">,<\/span> student<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u4e2d\u901a\u5e38\u5305\u542b\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u6210\u5458&#xff0c;\u4e0d\u80fd\u76f4\u63a5\u7528 %s \u8fd9\u6837\u7684\u683c\u5f0f\u8bf4\u660e\u7b26\u8f93\u51fa\u6574\u4e2a\u7ed3\u6784\u4f53\u3002<\/p>\n<p>\u4e5f\u4e0d\u80fd\u5bf9\u7ed3\u6784\u4f53\u53d8\u91cf\u53d6\u5730\u5740\u540e&#xff0c;\u518d\u7528\u4e0e\u6210\u5458\u4e0d\u5bf9\u5e94\u7684\u683c\u5f0f\u8bf4\u660e\u7b26\u6574\u4f53\u8f93\u51fa&#xff1a;<\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;%d&#xff0c;%s&#xff0c;%d&#xff0c;%f&#034;<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token operator\">&amp;<\/span>student<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n<p>&amp;student \u662f\u6574\u4e2a\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5730\u5740&#xff0c;\u5e76\u4e0d\u662f\u67d0\u4e2a\u5177\u4f53\u6210\u5458\u7684\u503c\u3002\u8981\u8f93\u51fa\u7ed3\u6784\u4f53\u4e2d\u7684\u5185\u5bb9&#xff0c;\u5e94\u5f53\u9010\u4e2a\u6210\u5458\u8fdb\u884c\u8f93\u51fa&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p><span class=\"token function\">printf<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">&#034;%d&#xff0c;%s&#xff0c;%d&#xff0c;%f&#034;<\/span><span class=\"token punctuation\">,<\/span> student<span class=\"token punctuation\">.<\/span>id<span class=\"token punctuation\">,<\/span> student<span class=\"token punctuation\">.<\/span>name<span class=\"token punctuation\">,<\/span> student<span class=\"token punctuation\">.<\/span>age<span class=\"token punctuation\">,<\/span> student<span class=\"token punctuation\">.<\/span>score<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C\u7ed3\u6784\u4f53\u57fa\u7840&#xff08;\u4e00&#xff09;\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53\u5efa\u7acb\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u75281. \u5f15\u7528\u6210\u5458\u7684\u57fa\u672c\u65b9\u5f0f\u8865\u5145&#xff1a;\u5b57\u7b26\u6570\u7ec4\u6210\u5458\u4e0d\u80fd\u76f4\u63a5\u8d4b\u503c\u65b9\u6cd5\u4e00&#xff1a;\u9010\u4e2a\u5b57\u7b26\u590d\u5236\u65b9\u6cd5\u4e8c&#xff1a;\u4f7f\u7528 strcpy \u51fd\u65702. \u6210\u5458\u672c\u8eab\u4e5f\u662f\u7ed3\u6784\u4f53\u65f6\u7684\u5f15\u7528\u65b9\u5f0f3. \u7ed3\u6784\u4f53\u6210\u5458\u53ef\u4ee5\u53c2\u4e0e\u8fd0\u7b974. \u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u53ef\u4ee5\u76f8\u4e92\u8d4b\u503c5. \u7ed3\u6784\u4f53\u53d8\u91cf\u548c\u6210\u5458\u90fd\u53ef\u4ee5\u53d6\u5730\u57406. \u4e24\u79cd\u9519\u8bef\u7528\u6cd5\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53<br \/>\n\u6570\u7ec4\u53ea\u80fd\u5b58\u50a8\u76f8\u540c\u7c7b\u578b\u7684\u6570\u636e&amp;#xff0c<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,1813,427],"topic":[],"class_list":["post-113737","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-1813","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/113737.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"C\u7ed3\u6784\u4f53\u57fa\u7840&#xff08;\u4e00&#xff09;\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53\u5efa\u7acb\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u75281. \u5f15\u7528\u6210\u5458\u7684\u57fa\u672c\u65b9\u5f0f\u8865\u5145&#xff1a;\u5b57\u7b26\u6570\u7ec4\u6210\u5458\u4e0d\u80fd\u76f4\u63a5\u8d4b\u503c\u65b9\u6cd5\u4e00&#xff1a;\u9010\u4e2a\u5b57\u7b26\u590d\u5236\u65b9\u6cd5\u4e8c&#xff1a;\u4f7f\u7528 strcpy \u51fd\u65702. \u6210\u5458\u672c\u8eab\u4e5f\u662f\u7ed3\u6784\u4f53\u65f6\u7684\u5f15\u7528\u65b9\u5f0f3. \u7ed3\u6784\u4f53\u6210\u5458\u53ef\u4ee5\u53c2\u4e0e\u8fd0\u7b974. \u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u53ef\u4ee5\u76f8\u4e92\u8d4b\u503c5. \u7ed3\u6784\u4f53\u53d8\u91cf\u548c\u6210\u5458\u90fd\u53ef\u4ee5\u53d6\u5730\u57406. \u4e24\u79cd\u9519\u8bef\u7528\u6cd5\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53 \u6570\u7ec4\u53ea\u80fd\u5b58\u50a8\u76f8\u540c\u7c7b\u578b\u7684\u6570\u636e&amp;#xff0c\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/113737.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-07T02:41:09+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113737.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/113737.html\",\"name\":\"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-07T02:41:09+00:00\",\"dateModified\":\"2026-10-07T02:41:09+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/113737.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/113737.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/113737.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/113737.html","og_locale":"zh_CN","og_type":"article","og_title":"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"C\u7ed3\u6784\u4f53\u57fa\u7840&#xff08;\u4e00&#xff09;\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53\u5efa\u7acb\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u53d8\u91cf\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u521d\u59cb\u5316\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u75281. \u5f15\u7528\u6210\u5458\u7684\u57fa\u672c\u65b9\u5f0f\u8865\u5145&#xff1a;\u5b57\u7b26\u6570\u7ec4\u6210\u5458\u4e0d\u80fd\u76f4\u63a5\u8d4b\u503c\u65b9\u6cd5\u4e00&#xff1a;\u9010\u4e2a\u5b57\u7b26\u590d\u5236\u65b9\u6cd5\u4e8c&#xff1a;\u4f7f\u7528 strcpy \u51fd\u65702. \u6210\u5458\u672c\u8eab\u4e5f\u662f\u7ed3\u6784\u4f53\u65f6\u7684\u5f15\u7528\u65b9\u5f0f3. \u7ed3\u6784\u4f53\u6210\u5458\u53ef\u4ee5\u53c2\u4e0e\u8fd0\u7b974. \u540c\u7c7b\u578b\u7684\u7ed3\u6784\u4f53\u53d8\u91cf\u53ef\u4ee5\u76f8\u4e92\u8d4b\u503c5. \u7ed3\u6784\u4f53\u53d8\u91cf\u548c\u6210\u5458\u90fd\u53ef\u4ee5\u53d6\u5730\u57406. \u4e24\u79cd\u9519\u8bef\u7528\u6cd5\u4ec0\u4e48\u662f\u7ed3\u6784\u4f53 \u6570\u7ec4\u53ea\u80fd\u5b58\u50a8\u76f8\u540c\u7c7b\u578b\u7684\u6570\u636e&amp;#xff0c","og_url":"https:\/\/www.wsisp.com\/helps\/113737.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-07T02:41:09+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/113737.html","url":"https:\/\/www.wsisp.com\/helps\/113737.html","name":"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-07T02:41:09+00:00","dateModified":"2026-10-07T02:41:09+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/113737.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/113737.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/113737.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C\u7ed3\u6784\u4f53\u57fa\u7840\uff08\u4e00\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113737","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=113737"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/113737\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=113737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=113737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=113737"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=113737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}