{"id":105374,"date":"2026-09-15T10:56:23","date_gmt":"2026-09-15T02:56:23","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/105374.html"},"modified":"2026-09-15T10:56:23","modified_gmt":"2026-09-15T02:56:23","slug":"c%e5%85%a5%e9%97%a8","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/105374.html","title":{"rendered":"c++\u5165\u95e8"},"content":{"rendered":"<h3 style=\"background-color:transparent\">\u524d\u8a00&#xff1a;<\/h3>\n<p><span style=\"color:#1f2329\">C&#043;&#043;\u517c\u5bb9C\u8bed\u2f94\u7edd\u2f24\u591a\u6570\u7684\u8bed\u6cd5&#xff0c;\u6240\u4ee5C\u8bed\u2f94\u5b9e\u73b0\u7684hello world\u4f9d\u65e7\u53ef\u4ee5\u8fd0\u2f8f&#xff0c;C&#043;&#043;\u4e2d\u9700\u8981\u628a\u5b9a\u4e49\u2f42\u4ef6 \u4ee3\u7801\u540e\u7f00\u6539\u4e3a.cpp&#xff0c;vs\u7f16\u8bd1\u5668\u770b\u5230\u662f.cpp\u5c31\u4f1a\u8c03\u2f64C&#043;&#043;\u7f16\u8bd1\u5668\u7f16\u8bd1<\/span><\/p>\n<h3><span style=\"color:#0d0016\">\u4e00&#xff1a;\u547d\u540d\u7a7a\u95f4&#xff08;namespace&#xff09;<\/span><\/h3>\n<h4><span style=\"color:#0d0016\">1.\u4e3a\u4ec0\u4e48\u8981\u7528\u547d\u540d\u7a7a\u95f4<\/span><\/h4>\n<p><span style=\"color:#1f2329\">\u5728C\/C&#043;&#043;\u4e2d&#xff0c;\u53d8\u91cf\u3001\u51fd\u6570\u548c\u540e\u2faf\u8981\u5b66\u5230\u7684\u7c7b\u90fd\u662f\u2f24\u91cf\u5b58\u5728\u7684&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u3001\u51fd\u6570\u548c\u7c7b\u7684\u540d\u79f0\u5c06\u90fd\u5b58\u5728\u4e8e\u5168\u5c40\u4f5c\u2f64\u57df\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\u5f88\u591a\u51b2\u7a81\u3002\u4f7f\u2f64\u547d\u540d\u7a7a\u95f4\u7684\u2f6c\u7684\u662f\u5bf9\u6807\u8bc6\u7b26\u7684\u540d\u79f0\u8fdb\u2f8f\u672c\u5730\u5316&#xff0c;\u4ee5\u907f\u514d\u547d\u540d \u51b2\u7a81\u6216\u540d\u5b57\u6c61\u67d3&#xff0c;namespace\u5173\u952e\u5b57\u7684\u51fa\u73b0\u5c31\u662f\u9488\u5bf9\u8fd9\u79cd\u95ee\u9898\u7684\u3002 <\/span><\/p>\n<p>\u547d\u540d\u7a7a\u95f4&#xff08;namespace&#xff09;\u662f C&#043;&#043; \u7528namespace \u5173\u952e\u5b57\u628a\u6807\u8bc6\u7b26&#xff08;\u53d8\u91cf\u3001\u51fd\u6570\u3001\u7c7b\u578b&#xff09;\u7684\u540d\u5b57&#034;\u5173&#034;\u8fdb\u4e00\u4e2a\u72ec\u7acb\u7684\u4f5c\u7528\u57df\u91cc&#xff0c;\u4ece\u800c\u907f\u514d\u547d\u540d\u51b2\u7a81\u548c\u540d\u5b57\u6c61\u67d3\u7684\u673a\u5236\u3002<\/p>\n<p>\u53ef\u4ee5\u770b\u4e00\u4e2ac\u8bed\u8a00\u4e2d\u7684\u4f8b\u5b50&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<\/p>\n<p>int rand &#061; 10;        \/\/ \u60f3\u5b9a\u4e49\u4e00\u4e2a\u53eb rand \u7684\u53d8\u91cf<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201crand\u201d: \u91cd\u5b9a\u4e49&#xff1b;\u4ee5\u524d\u7684\u5b9a\u4e49\u662f\u201c\u51fd\u6570\u201d<br \/>\n    printf(&#034;%d\\\\n&#034;, rand);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p style=\"text-align:center\">\u7ed3\u679c\u62a5\u9519&#xff1a;<img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915025621-6aa8b3d55a9c7.png\" \/><\/p>\n<p>\u56e0\u4e3a&lt;stdlib.h&gt; \u91cc\u5df2\u7ecf\u6709\u4e00\u4e2a rand() \u51fd\u6570&#xff0c;\u53c8\u5b9a\u4e49\u4e86\u4e00\u4e2a\u5168\u5c40\u53d8\u91cf rand\u2014\u2014\u5168\u5c40\u4f5c\u7528\u57df\u53ea\u6709\u4e00\u4e2a&#xff0c;\u540d\u5b57\u649e\u8f66\u5c31\u76f4\u63a5\u7f16\u8bd1\u62a5\u9519\u3002\u8fd9\u5728 C \u9879\u76ee\u91cc\u662f\u666e\u904d\u5b58\u5728\u7684\u95ee\u9898\u3002<\/p>\n<p>C&#043;&#043; \u5f15\u5165 namespace \u5c31\u662f\u4e3a\u4e86\u66f4\u597d\u5730\u89e3\u51b3\u8fd9\u7c7b\u95ee\u9898\u3002<\/p>\n<h4>2.\u547d\u540d\u7a7a\u95f4\u7684\u4f7f\u7528<\/h4>\n<p>namespace \u540d\u5b57        \/\/ \u540d\u5b57\u4e00\u822c\u7528\u9879\u76ee\u540d\u53ef\u7528\u81ea\u5df1\u540d\u5b57\u7f29\u5199<br \/>\n{<br \/>\n    \/\/ \u91cc\u9762\u53ef\u4ee5\u5b9a\u4e49\u53d8\u91cf \/ \u51fd\u6570 \/ \u7c7b\u578b<br \/>\n}<\/p>\n<p>\u4ee5\u4e0a\u9762rand\u53d8\u91cf\u4e3e\u4f8b&#xff0c;\u5c06rand\u653e\u5165namespace\u91cc&#xff0c;\u5c31\u4e0d\u4f1a\u62a5\u9519<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<\/p>\n<p>\/\/ 1. \u6b63\u5e38\u7684\u547d\u540d\u7a7a\u95f4\u5b9a\u4e49<br \/>\nnamespace hu<br \/>\n{<br \/>\n    int rand &#061; 10;                       \/\/ \u53d8\u91cf<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    \/\/ \u9ed8\u8ba4\u8bbf\u95ee\u7684\u662f\u5168\u5c40\u7684 rand \u51fd\u6570\u6307\u9488<br \/>\n    printf(&#034;%p\\\\n&#034;, rand);<\/p>\n<p>    \/\/ \u6307\u5b9a hu \u547d\u540d\u7a7a\u95f4\u4e2d\u7684 rand<br \/>\n    printf(&#034;%d\\\\n&#034;, hu::rand);\/\/:: \u53eb\u4f5c\u7528\u57df\u89e3\u6790\u8fd0\u7b97\u7b26<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915025621-6aa8b3d5a9e00.png\" \/><\/p>\n<p>namespace \u7684\u672c\u8d28\u662f&#034;\u5b9a\u4e49\u51fa\u4e00\u4e2a\u57df&#034;<\/p>\n<p>\u8fd9\u4e2a\u57df\u8ddf\u5168\u5c40\u57df\u5404\u81ea\u72ec\u7acb&#xff0c;\u6240\u4ee5\u4e0d\u540c\u7684\u57df\u53ef\u4ee5\u5b9a\u4e49\u540c\u540d\u53d8\u91cf\u3002\u4e0a\u9762\u7684 rand \u5c31\u4e0d\u518d\u51b2\u7a81\u4e86\u2014\u2014\u5168\u5c40\u6709\u81ea\u5df1\u7684 rand&#xff0c;hu \u57df\u91cc\u6709\u81ea\u5df1\u7684 rand\u3002<\/p>\n<h4>3.c&#043;&#043;\u4e2d\u76844\u79cd\u57df<\/h4>\n<table>\n<tr>\u57df\u5f71\u54cd\u7f16\u8bd1\u67e5\u627e\u5f71\u54cd\u53d8\u91cf\u751f\u547d\u5468\u671f<\/tr>\n<tbody>\n<tr>\n<td>\u51fd\u6570\u5c40\u90e8\u57df<\/td>\n<td>\u2705<\/td>\n<td>\u2705<\/td>\n<\/tr>\n<tr>\n<td>\u5168\u5c40\u57df<\/td>\n<td>\u2705<\/td>\n<td>\u2705<\/td>\n<\/tr>\n<tr>\n<td>\u547d\u540d\u7a7a\u95f4\u57df<\/td>\n<td>\u2705<\/td>\n<td>\u274c \u4e0d\u5f71\u54cd<\/td>\n<\/tr>\n<tr>\n<td>\u7c7b\u57df<\/td>\n<td>\u2705<\/td>\n<td>\u274c \u4e0d\u5f71\u54cd<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u57df\u5f71\u54cd\u7684\u662f\u7f16\u8bd1\u65f6\u8bed\u6cd5\u67e5\u627e\u4e00\u4e2a\u53d8\u91cf\/\u51fd\u6570\/\u7c7b\u578b\u51fa\u5904&#xff08;\u58f0\u660e\u6216\u5b9a\u4e49&#xff09;\u7684\u903b\u8f91&#xff0c;\u6240\u6709\u6709\u4e86\u57df\u9694\u79bb&#xff0c;\u540d\u5b57\u51b2\u7a81\u5c31\u89e3\u51b3\u4e86\u3002\u5c40\u90e8\u57df\u548c\u5168\u5c40\u57df\u9664\u4e86\u5f71\u54cd\u7f16\u8bd1\u67e5\u627e\u903b\u8f91&#xff0c;\u8fd8\u4f1a\u5f71\u54cd\u53d8\u91cf\u7684\u751f\u547d\u5468\u671f&#xff1b;\u547d\u540d\u7a7a\u95f4\u57df\u548c\u7c7b\u57df\u4e0d\u5f71\u54cd\u53d8\u91cf\u751f\u547d\u5468\u671f\u3002<\/p>\n<p>\u8fd9\u4e00\u70b9\u5f88\u5173\u952e&#xff1a;\u547d\u540d\u7a7a\u95f4\u91cc\u7684\u53d8\u91cf\u4ecd\u7136\u662f\u5168\u5c40\u53d8\u91cf&#xff08;\u5b58\u5728\u9759\u6001\u533a\u3001\u751f\u547d\u5468\u671f\u540c\u7a0b\u5e8f&#xff09;&#xff0c;\u5b83\u53ea\u662f\u6362\u4e86\u540d\u5b57\u67e5\u627e\u7684\u8def\u5f84&#xff0c;\u4e0d\u662f\u53d8\u6210\u4e86\u5c40\u90e8\u53d8\u91cf\u3002<\/p>\n<h4>4.namespace \u53ea\u80fd\u5b9a\u4e49\u5728\u5168\u5c40&#xff0c;\u4e14\u53ef\u4ee5\u5d4c\u5957<\/h4>\n<p>namespace byte<br \/>\n{<br \/>\nnamespace hu {<br \/>\nint rand &#061; 10;<br \/>\n}<br \/>\nnamespace yu {<br \/>\nint rand &#061; 20;<br \/>\n}<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\nprintf(&#034;%d\\\\n&#034;, byte::hu::rand);<br \/>\nprintf(&#034;%d\\\\n&#034;, byte::yu::rand);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915025622-6aa8b3d602510.png\" \/><\/p>\n<\/p>\n<h4>5.\u00a0\u591a\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u540c\u540d namespace \u4f1a\u5408\u5e76\u6210\u4e00\u4e2a<\/h4>\n<p>\/\/ Stack.h<br \/>\n#pragma once<br \/>\n#include&lt;stdio.h&gt;<br \/>\n#include&lt;stdlib.h&gt;<br \/>\n#include&lt;stdbool.h&gt;<br \/>\n#include&lt;assert.h&gt;<br \/>\nnamespace byte<br \/>\n{<br \/>\n    typedef int STDataType;<br \/>\n    typedef struct Stack<br \/>\n    {<br \/>\n        STDataType* a;<br \/>\n        int top;<br \/>\n        int capacity;<br \/>\n    }ST;<\/p>\n<p>    void STInit(ST* ps, int n);<br \/>\n    void STDestroy(ST* ps);<br \/>\n    void STPush(ST* ps, STDataType x);<br \/>\n    void STPop(ST* ps);<br \/>\n    STDataType STTop(ST* ps);<br \/>\n    int STSize(ST* ps);<br \/>\n    bool STEmpty(ST* ps);<br \/>\n}<\/p>\n<p>\/\/ Stack.cpp<br \/>\n#include&#034;Stack.h&#034;<br \/>\nnamespace byte                      \/\/ \u540c\u540d \u2192 \u81ea\u52a8\u5408\u5e76\u5230\u540c\u4e00\u4e2a bit \u4e2d<br \/>\n{<br \/>\n    void STInit(ST* ps, int n)<br \/>\n    {<br \/>\n        assert(ps);<br \/>\n        ps-&gt;a &#061; (STDataType*)malloc(n * sizeof(STDataType));<br \/>\n        ps-&gt;top &#061; 0;<br \/>\n        ps-&gt;capacity &#061; n;<br \/>\n    }<br \/>\n    void STPush(ST* ps, STDataType x) { \/* &#8230; *\/ }<br \/>\n    \/\/ &#8230;<br \/>\n}<\/p>\n<h4>6.\u540d\u5b57\u67e5\u627e\u9ed8\u8ba4\u4e0d\u5230\u547d\u540d\u7a7a\u95f4\u91cc\u627e<\/h4>\n<p>\u7f16\u8bd1\u67e5\u627e\u4e00\u4e2a\u53d8\u91cf\u7684\u58f0\u660e\/\u5b9a\u4e49\u65f6&#xff0c;\u9ed8\u8ba4\u53ea\u4f1a\u5728\u5c40\u90e8\u6216\u8005\u5168\u5c40\u67e5\u627e&#xff0c;\u4e0d\u4f1a\u5230\u547d\u540d\u7a7a\u95f4\u91cc\u9762\u53bb\u67e5\u627e\u3002<\/p>\n<p>#include&lt;stdio.h&gt;<br \/>\nnamespace byte<br \/>\n{<br \/>\n    int a &#061; 0;<br \/>\n    int b &#061; 1;<br \/>\n}<br \/>\nint main()<br \/>\n{<br \/>\n    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a; \u201ca\u201d: \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26<br \/>\n    printf(&#034;%d\\\\n&#034;, a);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u53ea\u6709\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u4e2d\u7684\u503c\u624d\u53ef\u4ee5\u67e5\u8be2\u5230<\/p>\n<p>#include&lt;stdio.h&gt;<br \/>\nnamespace byte<br \/>\n{<br \/>\n    int a &#061; 0;<br \/>\n    int b &#061; 1;<br \/>\n}<br \/>\nint main()<br \/>\n{<br \/>\n    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a; \u201ca\u201d: \u672a\u58f0\u660e\u7684\u6807\u8bc6\u7b26<br \/>\n    printf(&#034;%d\\\\n&#034;,byte:: a);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>7.namespace\u76844\u79cd\u5e38\u89c1\u4f7f\u7528\u65b9\u6cd5<\/p>\n<table>\n<tr>\u65b9\u5f0f\u5199\u6cd5\u5efa\u8bae<\/tr>\n<tbody>\n<tr>\n<td>\u2460 \u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee<\/td>\n<td>N::a<\/td>\n<td>\u9879\u76ee\u4e2d\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f<\/td>\n<\/tr>\n<tr>\n<td>\u2461 using \u5c06\u547d\u540d\u7a7a\u95f4\u4e2d\u67d0\u4e2a\u6210\u5458\u5c55\u5f00<\/td>\n<td>using N::b;<\/td>\n<td>\u9879\u76ee\u4e2d\u7ecf\u5e38\u8bbf\u95ee\u7684\u4e0d\u5b58\u5728\u51b2\u7a81\u7684\u6210\u5458\u63a8\u8350<\/td>\n<\/tr>\n<tr>\n<td>\u2462 \u5c55\u5f00\u547d\u540d\u7a7a\u95f4\u4e2d\u5168\u90e8\u6210\u5458<\/td>\n<td>using namespace N;<\/td>\n<td>\u9879\u76ee\u4e0d\u63a8\u8350&#xff0c;\u51b2\u7a81\u98ce\u9669\u5f88\u5927&#xff1b;\u65e5\u5e38\u5c0f\u7ec3\u4e60\u7a0b\u5e8f\u4e3a\u4e86\u65b9\u4fbf\u63a8\u8350\u4f7f\u7528<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u2460 \u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee<\/p>\n<p>\/\/  \u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee<br \/>\nint main()<br \/>\n{<br \/>\n    printf(&#034;%d\\\\n&#034;, N::a);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u2461 using \u5c06\u547d\u540d\u7a7a\u95f4\u4e2d\u67d0\u4e2a\u6210\u5458\u5c55\u5f00<\/p>\n<p>\/\/  using \u5c55\u5f00\u67d0\u4e2a\u6210\u5458<br \/>\nusing N::b;<br \/>\nint main()<br \/>\n{<br \/>\n    printf(&#034;%d\\\\n&#034;, N::a);<br \/>\n    printf(&#034;%d\\\\n&#034;, b);      \/\/ \u53ef\u4ee5\u76f4\u63a5\u7528 b \u4e86<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u2462 \u5c55\u5f00\u547d\u540d\u7a7a\u95f4\u4e2d\u5168\u90e8\u6210\u5458<\/p>\n<p>\/\/  \u5c55\u5f00\u5168\u90e8\u6210\u5458<br \/>\nusing namespace N;<br \/>\nint main()<br \/>\n{<br \/>\n    printf(&#034;%d\\\\n&#034;, a);<br \/>\n    printf(&#034;%d\\\\n&#034;, b);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u4e3a\u4ec0\u4e48\u9879\u76ee\u91cc\u4e0d\u63a8\u8350 using namespace std;&#xff1f;<\/p>\n<p>\u56e0\u4e3a\u5b83\u628a\u6574\u4e2a\u6807\u51c6\u5e93\u51e0\u5343\u4e2a\u540d\u5b57\u90fd\u5012\u8fdb\u4e86\u5168\u5c40\u57df&#xff0c;\u4e00\u65e6\u4f60\u81ea\u5df1\u7684\u51fd\u6570\/\u53d8\u91cf\u540d\u8ddf\u6807\u51c6\u5e93\u649e\u4e86&#xff08;\u6bd4\u5982\u81ea\u5df1\u5199\u4e86\u4e2a count\u3001data\u3001swap&#xff09;&#xff0c;\u5c31\u4f1a\u51fa\u73b0\u6b67\u4e49\u6216\u610f\u5916\u8c03\u7528\u5230\u6807\u51c6\u5e93\u7248\u672c&#xff0c;\u800c\u4e14\u62a5\u9519\u4fe1\u606f\u6781\u96be\u5b9a\u4f4d\u3002<\/p>\n<h3>\u4e8c&#xff1a;<span style=\"color:#1f2329\">C&#043;&#043;\u8f93\u2f0a\u548c\u8f93\u51fa<\/span><\/h3>\n<h4 style=\"background-color:transparent\"><span style=\"color:#1f2329\">2.1\u00a0<\/span>&lt;iostream&gt; \u4e0e\u4e09\u4e2a\u6807\u51c6\u5bf9\u8c61<\/h4>\n<p>&lt;iostream&gt; \u662f Input Output Stream&#xff08;\u8f93\u5165\u8f93\u51fa\u6d41&#xff09; \u7684\u7f29\u5199&#xff0c;\u662f C&#043;&#043; \u6807\u51c6\u7684\u8f93\u5165\u3001\u8f93\u51fa\u6d41\u5e93&#xff0c;\u5176\u4e2d\u5b9a\u4e49\u4e86\u6807\u51c6\u7684\u8f93\u5165\u3001\u8f93\u51fa\u5bf9\u8c61\u3002<\/p>\n<table>\n<tr>\u540d\u5b57\u7c7b\u578b\u542b\u4e49<\/tr>\n<tbody>\n<tr>\n<td>std::cin<\/td>\n<td>istream \u7c7b\u7684\u5bf9\u8c61<\/td>\n<td>\u4e3b\u8981\u9762\u5411\u7a84\u5b57\u7b26&#xff08;narrow characters, of type char&#xff09;\u7684\u6807\u51c6\u8f93\u5165\u6d41<\/td>\n<\/tr>\n<tr>\n<td>std::cout<\/td>\n<td>ostream \u7c7b\u7684\u5bf9\u8c61<\/td>\n<td>\u4e3b\u8981\u9762\u5411\u7a84\u5b57\u7b26\u7684\u6807\u51c6\u8f93\u51fa\u6d41<\/td>\n<\/tr>\n<tr>\n<td>std::endl<\/td>\n<td>\u4e00\u4e2a\u51fd\u6570&#xff08;\u51fd\u6570\u6a21\u677f&#xff09;<\/td>\n<td>\u6d41\u63d2\u5165\u8f93\u51fa\u65f6&#xff0c;\u76f8\u5f53\u4e8e\u63d2\u5165\u4e00\u4e2a\u6362\u884c\u5b57\u7b26 &#043; \u5237\u65b0\u7f13\u51b2\u533a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5728c\u8bed\u8a00\u4e2d<span style=\"color:#1f2329\">\u5b9e\u73b0\u7684hello world\u5982\u4e0b&#xff1a;<\/span><\/p>\n<p>int main()<\/p>\n<p>{<br \/>\nprintf(&#034;hello world\\\\n&#034;);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>\u800c\u5728c&#043;&#043;\u4e2d\u5219\u662f\u8fd9\u6837&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nint main()<\/p>\n<p>{<br \/>\nstd::cout &lt;&lt;&#034; hello world\\\\n&#034;;<br \/>\nreturn 0;<br \/>\n}<\/p>\n<h4>2.2\u00a0\u00a0&lt;&lt; \u548c &gt;&gt;&#xff1a;\u88ab&#034;\u590d\u7528&#034;\u7684\u8fd0\u7b97\u7b26<\/h4>\n<p>&lt;&lt; \u662f\u6d41\u63d2\u5165\u8fd0\u7b97\u7b26&#xff0c;&gt;&gt; \u662f\u6d41\u63d0\u53d6\u8fd0\u7b97\u7b26\u3002&#xff08;C \u8bed\u8a00\u8fd8\u7528\u8fd9\u4e24\u4e2a\u8fd0\u7b97\u7b26\u505a\u4f4d\u8fd0\u7b97\u5de6\u79fb\/\u53f3\u79fb&#xff09;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nint main()<\/p>\n<p>{<br \/>\nstd::cout &lt;&lt;&#034; hello world\\\\n&#034;;\/\/\u8f93\u51fa&#xff0c;\u5728\u5c4f\u5e55\u4e0a\u6253\u5370hello world<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nint main()<\/p>\n<p>{<br \/>\nint a &#061; 0;<br \/>\n\/\/std::cout &lt;&lt;&#034; hello world\\\\n&#034;;<br \/>\nstd::cin &gt;&gt; a;\/\/\u8f93\u5165a\u7684\u503c<br \/>\nstd::cout &lt;&lt; a;\/\/\u5728\u5c4f\u5e55\u4e0a\u6253\u5370\u6240\u8f93\u5165\u7684\u503c<br \/>\nreturn 0;<br \/>\n}<\/p>\n<h4>2.3\u00a0 \u6700\u5927\u7684\u4f18\u52bf&#xff1a;\u81ea\u52a8\u8bc6\u522b\u7c7b\u578b<\/h4>\n<p>\u4f7f\u7528 C&#043;&#043; \u8f93\u5165\u8f93\u51fa\u66f4\u65b9\u4fbf&#xff0c;\u4e0d\u9700\u8981\u50cf printf\/scanf \u8f93\u5165\u8f93\u51fa\u65f6\u90a3\u6837&#xff0c;\u9700\u8981\u624b\u52a8\u6307\u5b9a\u683c\u5f0f&#xff0c;C&#043;&#043; \u7684\u8f93\u5165\u8f93\u51fa\u53ef\u4ee5\u81ea\u52a8\u8bc6\u522b\u53d8\u91cf\u7c7b\u578b\u3002<\/p>\n<p>#define _CRT_SECURE_NO_WARNINGS 1<br \/>\n#include &lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int a &#061; 0;<br \/>\n    double b &#061; 0.1;<br \/>\n    char c &#061; &#039;x&#039;;<\/p>\n<p>    cout &lt;&lt; a &lt;&lt; &#034; &#034; &lt;&lt; b &lt;&lt; &#034;  &#034; &lt;&lt; c &lt;&lt; endl;<br \/>\n    std::cout &lt;&lt; a &lt;&lt; &#034; &#034; &lt;&lt; b &lt;&lt; &#034;  &#034; &lt;&lt; c &lt;&lt; std::endl;<\/p>\n<p>    scanf(&#034;%d%lf&#034;, &amp;a, &amp;b);       \/\/ C \u98ce\u683c&#xff1a;\u5fc5\u987b\u5199 %d %lf<br \/>\n    printf(&#034;%d %lf\\\\n&#034;, a, b);<\/p>\n<p>    cin &gt;&gt; a;                     \/\/ C&#043;&#043; \u98ce\u683c&#xff1a;\u81ea\u52a8\u8bc6\u522b\u7c7b\u578b<br \/>\n    cin &gt;&gt; b &gt;&gt; c;<br \/>\n    cout &lt;&lt; a &lt;&lt; endl;<br \/>\n    cout &lt;&lt; b &lt;&lt; &#034;  &#034; &lt;&lt; c &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u8fd9\u91cc\u6211\u4eec\u6ca1\u6709\u5305\u542b &lt;stdio.h&gt;&#xff0c;\u4e5f\u53ef\u4ee5\u4f7f\u7528 printf \u548c scanf&#xff0c;\u5728\u5305\u542b &lt;iostream&gt; \u95f4\u63a5\u5305\u542b\u4e86\u3002VS \u7cfb\u5217\u7f16\u8bd1\u5668\u662f\u8fd9\u6837\u7684&#xff0c;\u5176\u4ed6\u7f16\u8bd1\u5668\u53ef\u80fd\u4f1a\u62a5\u9519\u3002<\/p>\n<h4>2.4\u00a0\u00a0endl vs &#039;\\\\n&#039;&#xff1a;\u6362\u884c &#043; \u5237\u65b0<\/h4>\n<p>std::endl \u662f\u4e00\u4e2a\u51fd\u6570&#xff0c;\u6d41\u63d2\u5165\u8f93\u51fa\u65f6&#xff0c;\u76f8\u5f53\u4e8e\u63d2\u5165\u4e00\u4e2a\u6362\u884c\u5b57\u7b26\u52a0\u5237\u65b0\u7f13\u51b2\u533a\u3002<\/p>\n<p>cout &lt;&lt; &#034;hello&#034; &lt;&lt; endl;    \/\/ \u6362\u884c &#043; \u5237\u65b0\u7f13\u51b2\u533a<br \/>\ncout &lt;&lt; &#034;hello&#034; &lt;&lt; &#039;\\\\n&#039;;    \/\/ \u53ea\u6362\u884c&#xff0c;\u4e0d\u5237\u65b0<\/p>\n<ul>\n<li>\u5927\u91cf\u8f93\u51fa&#xff08;\u5faa\u73af\u91cc\u3001\u7ade\u8d5b\u9898&#xff09;\u7528 &#039;\\\\n&#039;&#xff0c;\u522b\u7528 endl&#xff1b;\u5426\u5219\u6bcf\u6b21\u5237\u65b0\u90fd\u4f1a\u62d6\u6162\u7a0b\u5e8f&#xff1b;<\/li>\n<li>\u9700\u8981\u7acb\u5373\u770b\u5230\u8f93\u51fa\u7684\u573a\u666f\u7528 endl&#xff08;\u5982\u4ea4\u4e92\u5f0f\u63d0\u793a\u3001\u5d29\u6e83\u524d\u60f3\u770b\u5230\u65e5\u5fd7&#xff09;\u3002<\/li>\n<\/ul>\n<h4>2.5\u00a0\u00a0\u547d\u540d\u7a7a\u95f4\u4e0e using namespace std<\/h4>\n<p>cout\/cin\/endl \u7b49\u90fd\u5c5e\u4e8e C&#043;&#043; \u6807\u51c6\u5e93&#xff0c;C&#043;&#043; \u6807\u51c6\u5e93\u90fd\u653e\u5728\u4e00\u4e2a\u53eb std&#xff08;standard&#xff09;\u7684\u547d\u540d\u7a7a\u95f4\u4e2d&#xff0c;\u6240\u4ee5\u8981\u901a\u8fc7\u547d\u540d\u7a7a\u95f4\u7684\u4f7f\u7528\u65b9\u5f0f\u53bb\u7528\u4ed6\u4eec\u3002 \u4e00\u822c\u65e5\u5e38\u7ec3\u4e60\u4e2d\u6211\u4eec\u53ef\u4ee5 using namespace std&#xff0c;\u5b9e\u9645\u9879\u76ee\u5f00\u53d1\u4e2d\u4e0d\u5efa\u8bae using namespace std,\u524d\u9762\u63d0\u5230\u8fc7\u539f\u56e0\u3002<\/p>\n<p>#include &lt;iostream&gt;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    std::cout &lt;&lt; &#034;\u5fc5\u987b\u5199 std::&#034; &lt;&lt; std::endl;      \/\/ \u65b9\u5f0f1&#xff1a;\u6307\u5b9a\u547d\u540d\u7a7a\u95f4\u8bbf\u95ee&#xff08;\u9879\u76ee\u63a8\u8350&#xff09;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nusing std::cout;        \/\/ \u65b9\u5f0f2&#xff1a;\u53ea\u5c55\u5f00\u9700\u8981\u7684&#xff08;\u9879\u76ee\u91cc\u6700\u5e38\u7528&#xff09;<br \/>\nusing std::endl;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;\u53ea\u5c55\u5f00\u7528\u5230\u7684\u540d\u5b57&#034; &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nusing namespace std;    \/\/ \u65b9\u5f0f3&#xff1a;\u5168\u90e8\u5c55\u5f00&#xff08;\u5c0f\u7ec3\u4e60\u65b9\u4fbf&#xff0c;\u9879\u76ee\u4e0d\u63a8\u8350&#xff09;<\/p>\n<p>int main()<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;\u65b9\u4fbf\u4f46\u6709\u51b2\u7a81\u98ce\u9669&#034; &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<h3>\u4e09&#xff1a;<span style=\"color:#1f2329\">\u7f3a\u7701\u53c2\u6570<\/span><\/h3>\n<h4>3.1 \u5b9a\u4e49<\/h4>\n<p>\u7f3a\u7701\u53c2\u6570\u662f\u58f0\u660e\u6216\u5b9a\u4e49\u51fd\u6570\u65f6\u4e3a\u51fd\u6570\u7684\u53c2\u6570\u6307\u5b9a\u4e00\u4e2a\u7f3a\u7701\u503c\u3002\u5728\u8c03\u7528\u8be5\u51fd\u6570\u65f6&#xff0c;\u5982\u679c\u6ca1\u6709\u6307\u5b9a\u5b9e\u53c2\u5219\u91c7\u7528\u8be5\u5f62\u53c2\u7684\u7f3a\u7701\u503c&#xff0c;\u5426\u5219\u4f7f\u7528\u6307\u5b9a\u7684\u5b9e\u53c2&#xff0c;\u7f3a\u7701\u53c2\u6570\u5206\u4e3a\u5168\u7f3a\u7701\u548c\u534a\u7f3a\u7701\u53c2\u6570\u3002<\/p>\n<p>void Func(int a &#061; 0)      \/\/ \u58f0\u660e\u65f6\u7ed9 a \u6307\u5b9a\u7f3a\u7701\u503c 0<br \/>\n{<br \/>\n    cout &lt;&lt; a &lt;&lt; endl;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    Func();      \/\/ \u6ca1\u6709\u4f20\u53c2 \u2192 \u4f7f\u7528\u7f3a\u7701\u503c 0&#xff0c;\u8f93\u51fa 0<br \/>\n    Func(10);    \/\/ \u4f20\u53c2     \u2192 \u4f7f\u7528\u6307\u5b9a\u5b9e\u53c2 10&#xff0c;\u8f93\u51fa 10<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>3.2 \u5168\u7f3a\u7701 vs \u534a\u7f3a\u7701<\/h4>\n<p>\u5168\u7f3a\u7701\u5c31\u662f\u5168\u90e8\u5f62\u53c2\u7ed9\u7f3a\u7701\u503c&#xff0c;\u534a\u7f3a\u7701\u5c31\u662f\u90e8\u5206\u5f62\u53c2\u7ed9\u7f3a\u7701\u503c\u3002<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>\/\/ \u5168\u7f3a\u7701&#xff1a;\u6240\u6709\u5f62\u53c2\u90fd\u6709\u7f3a\u7701\u503c<br \/>\nvoid Func1(int a &#061; 10, int b &#061; 20, int c &#061; 30)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;a &#061; &#034; &lt;&lt; a &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;b &#061; &#034; &lt;&lt; b &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;c &#061; &#034; &lt;&lt; c &lt;&lt; endl &lt;&lt; endl;<br \/>\n}<\/p>\n<p>\/\/ \u534a\u7f3a\u7701&#xff1a;\u53ea\u6709\u540e\u9762\u7684\u90e8\u5206\u5f62\u53c2\u6709\u7f3a\u7701\u503c<br \/>\nvoid Func2(int a, int b &#061; 10, int c &#061; 20)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;a &#061; &#034; &lt;&lt; a &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;b &#061; &#034; &lt;&lt; b &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &#034;c &#061; &#034; &lt;&lt; c &lt;&lt; endl &lt;&lt; endl;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    Func1();              \/\/ 10 20 30<br \/>\n    Func1(1);             \/\/  1 20 30<br \/>\n    Func1(1, 2);          \/\/  1  2 30<br \/>\n    Func1(1, 2, 3);       \/\/  1  2  3<\/p>\n<p>    \/\/ Func2();           \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;a \u6ca1\u6709\u5b9e\u53c2\u4e5f\u6ca1\u6709\u7f3a\u7701\u503c<br \/>\n    Func2(100);           \/\/ 100 10 20<br \/>\n    Func2(100, 200);      \/\/ 100 200 20<br \/>\n    Func2(100, 200, 300); \/\/ 100 200 300<br \/>\n    return 0;<br \/>\n}<\/p>\n<h5>3.2.1\u00a0\u00a0C&#043;&#043; \u89c4\u5b9a\u534a\u7f3a\u7701\u53c2\u6570\u5fc5\u987b\u4ece\u53f3\u5f80\u5de6\u4f9d\u6b21\u8fde\u7eed\u7f3a\u7701&#xff0c;\u4e0d\u80fd\u95f4\u9694\u8df3\u8dc3\u7ed9\u7f3a\u7701\u503c\u3002<\/h5>\n<p>\/\/ \u6b63\u786e&#xff1a;\u4ece\u53f3\u5f80\u5de6\u8fde\u7eed<br \/>\nvoid f(int a, int b &#061; 2, int c &#061; 3);      \/\/ \u7f3a\u7701\u7684\u662f b\u3001c&#xff08;\u53f3\u8fb9\u8fde\u7eed\u4e24\u4e2a&#xff09;<\/p>\n<p>\/\/ \u9519\u8bef&#xff1a;\u4e2d\u95f4\u8df3\u8fc7\u4e86<br \/>\n\/\/void f(int a &#061; 1, int b, int c &#061; 3);    \/\/ b \u5728\u4e2d\u95f4\u6ca1\u7f3a\u7701\u503c<br \/>\n\/\/void f(int a &#061; 1, int b &#061; 2, int c);    \/\/ \u6700\u53f3\u8fb9\u53cd\u800c\u6ca1\u7f3a\u7701\u503c<\/p>\n<h5>3.2.2\u00a0\u5e26\u7f3a\u7701\u53c2\u6570\u7684\u51fd\u6570\u8c03\u7528&#xff0c;C&#043;&#043; \u89c4\u5b9a\u5fc5\u987b\u4ece\u5de6\u5230\u53f3\u4f9d\u6b21\u7ed9\u5b9e\u53c2&#xff0c;\u4e0d\u80fd\u8df3\u8dc3\u7ed9\u5b9e\u53c2\u3002<\/h5>\n<p>void f(int a, int b &#061; 2, int c &#061; 3);<\/p>\n<p>f(1);         \/\/ a&#061;1, b&#061;2, c&#061;3<br \/>\nf(1, 5);      \/\/ a&#061;1, b&#061;5, c&#061;3<br \/>\nf(1, 5, 8);   \/\/ a&#061;1, b&#061;5, c&#061;8<\/p>\n<p>\/\/ f(1, , 8);   \/\/  \u8bed\u6cd5\u90fd\u4e0d\u5408\u6cd5&#xff0c;\u4e0d\u80fd&#034;\u8df3\u8fc7 b \u53ea\u7ed9 c&#034;<\/p>\n<h5>3.2.3\u00a0\u51fd\u6570\u58f0\u660e\u548c\u5b9a\u4e49\u5206\u79bb\u65f6&#xff0c;\u7f3a\u7701\u53c2\u6570\u4e0d\u80fd\u5728\u51fd\u6570\u58f0\u660e\u548c\u5b9a\u4e49\u4e2d\u540c\u65f6\u51fa\u73b0&#xff0c;\u89c4\u5b9a\u5fc5\u987b\u51fd\u6570\u58f0\u660e\u7ed9\u7f3a\u7701\u503c\u3002<\/h5>\n<p>\/\/ Stack.h<br \/>\n#include &lt;iostream&gt;<br \/>\n#include &lt;assert.h&gt;<br \/>\nusing namespace std;<br \/>\ntypedef int STDataType;<br \/>\ntypedef struct Stack<br \/>\n{<br \/>\n    STDataType* a;<br \/>\n    int top;<br \/>\n    int capacity;<br \/>\n}ST;<\/p>\n<p>void STInit(ST* ps, int n &#061; 4);      \/\/  \u7f3a\u7701\u503c\u7ed9\u5728\u3010\u58f0\u660e\u3011\u5904<\/p>\n<p>\/\/ Stack.cpp<br \/>\n#include&#034;Stack.h&#034;<\/p>\n<p>\/\/ \u7f3a\u7701\u53c2\u6570\u4e0d\u80fd\u58f0\u660e\u548c\u5b9a\u4e49\u540c\u65f6\u7ed9<br \/>\nvoid STInit(ST* ps, int n)           \/\/  \u5b9a\u4e49\u5904\u3010\u4e0d\u5199\u3011\u7f3a\u7701\u503c<br \/>\n{<br \/>\n    assert(ps &amp;&amp; n &gt; 0);<br \/>\n    ps-&gt;a &#061; (STDataType*)malloc(n * sizeof(STDataType));<br \/>\n    ps-&gt;top &#061; 0;<br \/>\n    ps-&gt;capacity &#061; n;<br \/>\n}<\/p>\n<p>\/\/ test.cpp<br \/>\n#include&#034;Stack.h&#034;<br \/>\nint main()<br \/>\n{<br \/>\n    ST s1;<br \/>\n    STInit(&amp;s1);                     \/\/ \u4f7f\u7528\u7f3a\u7701\u503c 4<\/p>\n<p>    \/\/ \u786e\u5b9a\u77e5\u9053\u8981\u63d2\u5165 1000 \u4e2a\u6570\u636e&#xff0c;\u521d\u59cb\u5316\u65f6\u4e00\u628a\u5f00\u597d&#xff0c;\u907f\u514d\u6269\u5bb9<br \/>\n    ST s2;<br \/>\n    STInit(&amp;s2, 1000);               \/\/ \u4f7f\u7528\u6307\u5b9a\u5b9e\u53c2<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u89c4\u5b9a&#xff1f;<\/h4>\n<p>\u56e0\u4e3a\u7f3a\u7701\u53c2\u6570\u662f\u5728\u7f16\u8bd1\u671f\u3001\u5728&#034;\u8c03\u7528\u70b9&#034;\u88ab\u66ff\u6362\u6210\u5b9e\u53c2\u7684\u2014\u2014\u5b83\u5c5e\u4e8e&#034;\u7f16\u8bd1\u671f\u8bed\u6cd5\u7cd6&#034;&#xff0c;\u7f16\u8bd1\u5668\u770b\u5230 STInit(&amp;s1) \u65f6&#xff0c;\u9700\u8981\u5f53\u573a\u628a\u5b83\u53d8\u6210 STInit(&amp;s1, 4)\u3002\u800c&#xff1a;<\/p>\n<ul>\n<li>test.cpp \u53ea #include &#034;Stack.h&#034;&#xff0c;\u5b83\u770b\u4e0d\u5230 Stack.cpp \u91cc\u7684\u5b9a\u4e49&#xff1b;<\/li>\n<li>\u5982\u679c\u7f3a\u7701\u503c\u5199\u5728\u5b9a\u4e49&#xff08;.cpp&#xff09;\u91cc&#xff0c;test.cpp \u7f16\u8bd1\u65f6\u6839\u672c\u4e0d\u77e5\u9053\u6709\u7f3a\u7701\u503c&#xff0c;\u5c31\u4f1a\u62a5&#034;\u53c2\u6570\u592a\u5c11&#034;\u7684\u9519\u3002<\/li>\n<\/ul>\n<h3>\u56db&#xff1a;\u51fd\u6570\u91cd\u8f7d<\/h3>\n<h4>4.1 \u5b9a\u4e49<\/h4>\n<p>C&#043;&#043; \u652f\u6301\u5728\u540c\u4e00\u4f5c\u7528\u57df\u4e2d\u51fa\u73b0\u540c\u540d\u51fd\u6570&#xff0c;\u4f46\u662f\u8981\u6c42\u8fd9\u4e9b\u540c\u540d\u51fd\u6570\u7684\u5f62\u53c2\u4e0d\u540c&#xff0c;\u53ef\u4ee5\u662f\u53c2\u6570\u4e2a\u6570\u4e0d\u540c\u6216\u8005\u7c7b\u578b\u4e0d\u540c\u3002\u8fd9\u6837 C&#043;&#043; \u51fd\u6570\u8c03\u7528\u5c31\u8868\u73b0\u51fa\u4e86\u591a\u6001\u884c\u4e3a&#xff0c;\u4f7f\u7528\u66f4\u7075\u6d3b\u3002C \u8bed\u8a00\u662f\u4e0d\u652f\u6301\u540c\u4e00\u4f5c\u7528\u57df\u4e2d\u51fa\u73b0\u540c\u540d\u51fd\u6570\u7684\u3002<\/p>\n<h4>4.2\u00a0\u6784\u6210\u91cd\u8f7d\u7684\u4e09\u79cd\u60c5\u51b5<\/h4>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>\/\/ 1\u3001\u53c2\u6570\u7c7b\u578b\u4e0d\u540c<br \/>\nint Add(int left, int right)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;int Add(int left, int right)&#034; &lt;&lt; endl;<br \/>\n    return left &#043; right;<br \/>\n}<br \/>\ndouble Add(double left, double right)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;double Add(double left, double right)&#034; &lt;&lt; endl;<br \/>\n    return left &#043; right;<br \/>\n}<\/p>\n<p>\/\/ 2\u3001\u53c2\u6570\u4e2a\u6570\u4e0d\u540c<br \/>\nvoid f()<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;f()&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nvoid f(int a)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;f(int a)&#034; &lt;&lt; endl;<br \/>\n}<\/p>\n<p>\/\/ 3\u3001\u53c2\u6570\u7c7b\u578b\u987a\u5e8f\u4e0d\u540c<br \/>\nvoid f(int a, char b)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;f(int a,char b)&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nvoid f(char b, int a)<br \/>\n{<br \/>\n    cout &lt;&lt; &#034;f(char b, int a)&#034; &lt;&lt; endl;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    Add(10, 20);         \/\/ \u2192 int Add(int left, int right)<br \/>\n    Add(10.1, 20.2);     \/\/ \u2192 double Add(double left, double right)<br \/>\n    f();                 \/\/ \u2192 f()<br \/>\n    f(10);               \/\/ \u2192 f(int a)<br \/>\n    f(10, &#039;a&#039;);          \/\/ \u2192 f(int a,char b)<br \/>\n    f(&#039;a&#039;, 10);          \/\/ \u2192 f(char b, int a)<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>4.3\u00a0\u56db\u79cd&#034;\u770b\u8d77\u6765\u50cf\u91cd\u8f7d\u4f46\u4e0d\u662f&#034;\u7684\u60c5\u51b5<\/h4>\n<h5>4.3.1\u00a0\u8fd4\u56de\u503c\u4e0d\u540c \u2014\u2014 \u4e0d\u80fd\u4f5c\u4e3a\u91cd\u8f7d\u6761\u4ef6<\/h5>\n<p>\/\/ \u8fd4\u56de\u503c\u4e0d\u540c\u4e0d\u80fd\u4f5c\u4e3a\u91cd\u8f7d\u6761\u4ef6&#xff0c;\u56e0\u4e3a\u8c03\u7528\u65f6\u4e5f\u65e0\u6cd5\u533a\u5206<br \/>\n\/\/void fxx()<br \/>\n\/\/{}<br \/>\n\/\/<br \/>\n\/\/int fxx()<br \/>\n\/\/{<br \/>\n\/\/        return 0;<br \/>\n\/\/}<\/p>\n<h5>4.3.2\u00a0\u4ec5\u9876\u5c42 const \u4fee\u9970\u503c\u53c2\u6570 \u2014\u2014 \u4e0d\u80fd\u91cd\u8f7d<\/h5>\n<p>void g(int a);<br \/>\n\/\/void g(const int a);    \/\/ \u62a5&#034;\u91cd\u5b9a\u4e49&#034;&#xff1a;\u4e0e\u4e0a\u9762\u662f\u540c\u4e00\u4e2a\u51fd\u6570<\/p>\n<h5>4.3.3\u00a0\u4f46 const \u4fee\u9970&#034;\u5f15\u7528\/\u6307\u9488\u6240\u6307\u5bf9\u8c61&#034; \u2014\u2014 \u53ef\u4ee5\u91cd\u8f7d&#xff08;\u5f15\u7528\u540e\u9762\u4f1a\u8bb2&#xff09;<\/h5>\n<p>void h(int&amp; x);              \/\/ \u5de6\u503c\u5f15\u7528\u7248\u672c<br \/>\nvoid h(const int&amp; x);        \/\/ const \u5de6\u503c\u5f15\u7528\u7248\u672c&#xff08;\u8fd8\u80fd\u63a5\u53f3\u503c&#xff09;\u6784\u6210\u91cd\u8f7d<\/p>\n<p>int a &#061; 1;<br \/>\nh(a);                        \/\/ \u2192 h(int&amp;)<br \/>\nh(10);                       \/\/ \u2192 h(const int&amp;)  \u5b57\u9762\u91cf\u53ea\u80fd\u7ed1 const \u5f15\u7528<br \/>\nconst int b &#061; 2;<br \/>\nh(b);                        \/\/ \u2192 h(const int&amp;)<\/p>\n<h5>4.3.4\u00a0\u4ec5\u9760\u7f3a\u7701\u53c2\u6570 \u2014\u2014 \u4e0d\u6784\u6210\u91cd\u8f7d&#xff0c;\u53cd\u800c\u5236\u9020\u6b67\u4e49<\/h5>\n<p>void f(int a);<br \/>\nvoid f(int a &#061; 1);        \/\/ \u4e0d\u6784\u6210\u91cd\u8f7d&#xff08;\u5f62\u53c2\u5217\u8868\u76f8\u540c&#xff09;\u2192 \u62a5\u91cd\u5b9a\u4e49<\/p>\n<h3>\u4e94&#xff1a;\u5f15\u7528<\/h3>\n<h4>5.1 \u6982\u5ff5\u548c\u8bed\u6cd5<\/h4>\n<p>\u5f15\u7528\u4e0d\u662f\u65b0\u5b9a\u4e49\u4e00\u4e2a\u53d8\u91cf&#xff0c;\u800c\u662f\u7ed9\u5df2\u5b58\u5728\u53d8\u91cf\u53d6\u4e86\u4e00\u4e2a\u522b\u540d&#xff0c;\u7f16\u8bd1\u5668\u4e0d\u4f1a\u4e3a\u5f15\u7528\u53d8\u91cf\u5f00\u8f9f\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5b83\u548c\u5b83\u5f15\u7528\u7684\u53d8\u91cf\u5171\u7528\u540c\u4e00\u5757\u5185\u5b58\u7a7a\u95f4\u3002 \u6bd4\u5982&#xff1a;\u6c34\u6d52\u4f20\u4e2d\u674e\u9035&#xff0c;\u5b8b\u6c5f\u53eb&#034;\u94c1\u725b&#034;&#xff0c;\u6c5f\u6e56\u4e0a\u4eba\u79f0&#034;\u9ed1\u65cb\u98ce&#034;&#xff1b;\u6797\u51b2&#xff0c;\u5916\u53f7\u8c79\u5b50\u5934\u3002<\/p>\n<p>\u7c7b\u578b&amp; \u5f15\u7528\u522b\u540d &#061; \u5f15\u7528\u5bf9\u8c61;<\/p>\n<p>\u00a0 1.&amp; \u7d27\u8ddf\u5728\u7c7b\u578b\u540e\u9762&#xff08;int&amp; b&#xff09;&#xff0c;\u800c\u4e0d\u662f\u53d8\u91cf\u540d\u540e\u9762\u3002int &amp; b \u548c int&amp; b \u7b49\u4ef7<\/p>\n<p>\u00a0 \u00a0 \u00a0 2.\u5b9a\u4e49\u65f6\u5fc5\u987b\u521d\u59cb\u5316&#xff0c;int&amp; ra; \u76f4\u63a5\u7f16\u8bd1\u62a5\u9519&#xff1b;<\/p>\n<p>\u00a0 \u00a0 \u00a0 3.\u5f15\u7528\u4e0d\u662f\u5bf9\u8c61&#xff0c;\u5b83\u6ca1\u6709\u72ec\u7acb\u5730\u5740&#xff0c;&amp;b \u5f97\u5230\u7684\u662f a \u7684\u5730\u5740\u3002<\/p>\n<h4>5.2 \u4e09\u5927\u7279\u6027<\/h4>\n<p>\u00a0 \u00a0 \u00a0 1.\u5f15\u7528\u5728\u5b9a\u4e49\u65f6\u5fc5\u987b\u521d\u59cb\u5316<\/p>\n<p>\u00a0 \u00a0 \u00a0 2.\u4e00\u4e2a\u53d8\u91cf\u53ef\u4ee5\u6709\u591a\u4e2a\u5f15\u7528<\/p>\n<p>\u00a0 \u00a0 \u00a0\u00a03.\u5f15\u7528\u4e00\u65e6\u5f15\u7528\u4e00\u4e2a\u5b9e\u4f53&#xff0c;\u518d\u4e0d\u80fd\u5f15\u7528\u5176\u4ed6\u5b9e\u4f53<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int a &#061; 10;<\/p>\n<p>    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201cra\u201d: \u5fc5\u987b\u521d\u59cb\u5316\u5f15\u7528<br \/>\n    \/\/int&amp; ra;<\/p>\n<p>    int&amp; b &#061; a;<br \/>\n    int c &#061; 20;<\/p>\n<p>    \/\/ \u8fd9\u91cc\u5e76\u975e\u8ba9 b \u5f15\u7528 c&#xff0c;\u56e0\u4e3a C&#043;&#043; \u5f15\u7528\u4e0d\u80fd\u6539\u53d8\u6307\u5411&#xff0c;<br \/>\n    \/\/ \u8fd9\u91cc\u662f\u4e00\u4e2a\u8d4b\u503c<br \/>\n    b &#061; c;<\/p>\n<p>    cout &lt;&lt; &amp;a &lt;&lt; endl;   \/\/ \u4e0e &amp;b \u76f8\u540c<br \/>\n    cout &lt;&lt; &amp;b &lt;&lt; endl;<br \/>\n    cout &lt;&lt; &amp;c &lt;&lt; endl;   \/\/ \u4e0e\u524d\u4e24\u4e2a\u4e0d\u540c<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>5.3 \u4f7f\u7528\u573a\u666f<\/h4>\n<p>\u5f15\u7528\u5728\u5b9e\u8df5\u4e2d\u4e3b\u8981\u662f\u4e8e\u5f15\u7528\u4f20\u53c2\u548c\u5f15\u7528\u505a\u8fd4\u56de\u503c\u4e2d\u51cf\u5c11\u62f7\u8d1d\u63d0\u9ad8\u6548\u7387\u548c\u6539\u53d8\u5f15\u7528\u5bf9\u8c61\u65f6\u540c\u65f6\u6539\u53d8\u88ab\u5f15\u7528\u5bf9\u8c61\u3002 \u5f15\u7528\u4f20\u53c2\u8ddf\u6307\u9488\u4f20\u53c2\u529f\u80fd\u662f\u7c7b\u4f3c\u7684&#xff0c;\u5f15\u7528\u4f20\u53c2\u76f8\u5bf9\u66f4\u65b9\u4fbf\u4e00\u4e9b\u3002<\/p>\n<h5>5.3.1\u00a0\u5f15\u7528\u4f20\u53c2<\/h5>\n<p>\u4fee\u6539\u5b9e\u53c2<\/p>\n<p>void Swap(int&amp; rx, int&amp; ry)<br \/>\n{<br \/>\n    int tmp &#061; rx;<br \/>\n    rx &#061; ry;<br \/>\n    ry &#061; tmp;<br \/>\n}<br \/>\nint main()<br \/>\n{<br \/>\n    int x &#061; 0, y &#061; 1;<br \/>\n    cout &lt;&lt; x &lt;&lt; &#034; &#034; &lt;&lt; y &lt;&lt; endl;   \/\/ 0 1<br \/>\n    Swap(x, y);                     \/\/ \u76f4\u63a5\u4f20\u53d8\u91cf\u540d&#xff0c;\u4e0d\u9700\u8981 &amp;x, &amp;y<br \/>\n    cout &lt;&lt; x &lt;&lt; &#034; &#034; &lt;&lt; y &lt;&lt; endl;   \/\/ 1 0<br \/>\n    return 0;<br \/>\n}<\/p>\n<h5>5.3.2\u00a0\u5f15\u7528\u505a\u8fd4\u56de\u503c<\/h5>\n<p>\u5f15\u7528\u8fd4\u56de\u8ba9\u51fd\u6570\u8c03\u7528\u6210\u4e3a&#034;\u5de6\u503c&#034;<\/p>\n<p>int&amp; STTop(ST&amp; rs)<br \/>\n{<br \/>\n return rs.a[rs.top];<br \/>\n}                                              \/\/ \u8fd4\u56de\u6570\u7ec4\u5143\u7d20\u7684\u5f15\u7528<br \/>\nSTTop(st1) &#043;&#061; 10;                              \/\/ \u76f8\u5f53\u4e8e rs.a[rs.top] &#043;&#061; 10<\/p>\n<h4>5.4\u00a0\u4e0d\u8981\u8fd4\u56de\u5c40\u90e8\u5bf9\u8c61\u7684\u5f15\u7528&#xff08;\u91ce\u5f15\u7528&#xff09;<\/h4>\n<p>\u4f20\u503c\u8fd4\u56de\u4f1a\u4ea7\u751f\u4e00\u4e2a\u4e34\u65f6\u5bf9\u8c61\u8c03\u7528\u62f7\u8d1d\u6784\u9020&#xff0c;\u4f20\u5f15\u7528\u8fd4\u56de&#xff0c;\u8fd4\u56de\u7684\u662f\u8fd4\u56de\u5bf9\u8c61\u7684\u522b\u540d&#xff08;\u5f15\u7528&#xff09;&#xff0c;\u6ca1\u6709\u4ea7\u751f\u62f7\u8d1d\u3002\u4f46\u662f\u5982\u679c\u8fd4\u56de\u5bf9\u8c61\u662f\u4e00\u4e2a\u5f53\u524d\u51fd\u6570\u5c40\u90e8\u57df\u7684\u5c40\u90e8\u5bf9\u8c61&#xff0c;\u51fd\u6570\u7ed3\u675f\u5c31\u9500\u6bc1\u4e86&#xff0c;\u90a3\u4e48\u4f7f\u7528\u5f15\u7528\u8fd4\u56de\u662f\u6709\u95ee\u9898\u7684&#xff0c;\u8fd9\u65f6\u7684\u5f15\u7528\u76f8\u5f53\u4e8e\u4e00\u4e2a\u91ce\u5f15\u7528&#xff0c;\u7c7b\u4f3c\u4e00\u4e2a\u91ce\u6307\u9488\u4e00\u6837\u3002\u4f20\u5f15\u7528\u8fd4\u56de\u53ef\u4ee5\u51cf\u5c11\u62f7\u8d1d&#xff0c;\u4f46\u662f\u4e00\u5b9a\u8981\u786e\u4fdd\u8fd4\u56de\u5bf9\u8c61&#xff0c;\u5728\u5f53\u524d\u51fd\u6570\u7ed3\u675f\u540e\u8fd8\u5728&#xff0c;\u624d\u80fd\u7528\u5f15\u7528\u8fd4\u56de\u3002<\/p>\n<p>\/\/ Date Func2()<br \/>\nDate&amp; Func2()<br \/>\n{<br \/>\n    Date tmp(2024, 7, 5);<br \/>\n    tmp.Print();<br \/>\n    return tmp;        \/\/ tmp \u662f\u5c40\u90e8\u5bf9\u8c61&#xff0c;\u51fd\u6570\u7ed3\u675f\u5c31\u9500\u6bc1<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    Date ret &#061; Func2();   \/\/ \u8bfb\u7684\u662f\u5df2\u9500\u6bc1\u5bf9\u8c61\u7684&#034;\u5e7d\u7075\u5185\u5b58&#034; \u2014\u2014 \u672a\u5b9a\u4e49\u884c\u4e3a<br \/>\n    ret.Print();<br \/>\n}<\/p>\n<h4>5.5\u00a0const \u5f15\u7528<\/h4>\n<h5>5.5.1\u00a0\u6838\u5fc3\u89c4\u5219&#xff1a;\u6743\u9650\u53ea\u80fd\u7f29\u5c0f&#xff0c;\u4e0d\u80fd\u653e\u5927<\/h5>\n<p>\u53ef\u4ee5\u5f15\u7528\u4e00\u4e2a const \u5bf9\u8c61&#xff0c;\u4f46\u662f\u5fc5\u987b\u7528 const \u5f15\u7528\u3002const \u5f15\u7528\u4e5f\u53ef\u4ee5\u5f15\u7528\u666e\u901a\u5bf9\u8c61&#xff0c;\u56e0\u4e3a\u5bf9\u8c61\u7684\u8bbf\u95ee\u6743\u9650\u5728\u5f15\u7528\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u7f29\u5c0f&#xff0c;\u4f46\u662f\u4e0d\u80fd\u653e\u5927\u3002<\/p>\n<p>int main()<br \/>\n{<br \/>\n    const int a &#061; 10;<\/p>\n<p>    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201c\u521d\u59cb\u5316\u201d: \u65e0\u6cd5\u4ece\u201cconst int\u201d\u8f6c\u6362\u4e3a\u201cint &amp;\u201d<br \/>\n    \/\/ \u8fd9\u91cc\u7684\u5f15\u7528\u662f\u5bf9 a \u8bbf\u95ee\u6743\u9650\u7684\u653e\u5927<br \/>\n    \/\/int&amp; ra &#061; a;<\/p>\n<p>    \/\/ \u8fd9\u6837\u624d\u53ef\u4ee5<br \/>\n    const int&amp; ra &#061; a;<\/p>\n<p>    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201cra\u201d: \u4e0d\u80fd\u7ed9\u5e38\u91cf\u8d4b\u503c<br \/>\n    \/\/ra&#043;&#043;;<\/p>\n<p>    \/\/ \u8fd9\u91cc\u7684\u5f15\u7528\u662f\u5bf9 b \u8bbf\u95ee\u6743\u9650\u7684\u7f29\u5c0f<br \/>\n    int b &#061; 20;<br \/>\n    const int&amp; rb &#061; b;<\/p>\n<p>    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201crb\u201d: \u4e0d\u80fd\u7ed9\u5e38\u91cf\u8d4b\u503c<br \/>\n    \/\/rb&#043;&#043;;<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<h5>5.5.2\u00a0\u4e34\u65f6\u5bf9\u8c61\u5fc5\u987b\u7528 const \u5f15\u7528<\/h5>\n<p>\u4e0d\u9700\u8981\u6ce8\u610f\u7684\u662f\u7c7b\u4f3c int&amp; rb &#061; a*3; double d &#061; 12.34; int&amp; rd &#061; d; \u8fd9\u6837\u4e00\u4e9b\u573a\u666f\u4e0b a*3 \u7684\u548c\u7ed3\u679c\u4fdd\u5b58\u5728\u4e00\u4e2a\u4e34\u65f6\u5bf9\u8c61\u4e2d&#xff0c;int&amp; rd &#061; d \u4e5f\u662f\u7c7b\u4f3c&#xff0c;\u5728\u7c7b\u578b\u8f6c\u6362\u4e2d\u4f1a\u4ea7\u751f\u4e34\u65f6\u5bf9\u8c61\u5b58\u50a8\u4e2d\u95f4\u503c&#xff0c;\u4e5f\u5c31\u662f\u65f6&#xff0c;rb \u548c rd \u5f15\u7528\u7684\u90fd\u662f\u4e34\u65f6\u5bf9\u8c61&#xff0c;\u800c C&#043;&#043; \u89c4\u5b9a\u4e34\u65f6\u5bf9\u8c61\u5177\u6709\u5e38\u6027&#xff0c;\u6240\u4ee5\u8fd9\u91cc\u5c31\u89e6\u53d1\u4e86\u6743\u9650\u653e\u5927&#xff0c;\u5fc5\u987b\u8981\u7528\u5e38\u5f15\u7528\u624d\u53ef\u4ee5\u3002<\/p>\n<p>\u6240\u8c13\u4e34\u65f6\u5bf9\u8c61\u5c31\u662f\u7f16\u8bd1\u5668\u9700\u8981\u4e00\u4e2a\u7a7a\u95f4\u6682\u5b58\u8868\u8fbe\u5f0f\u7684\u6c42\u503c\u7ed3\u679c\u65f6\u4e34\u65f6\u521b\u5efa\u7684\u4e00\u4e2a\u672a\u547d\u540d\u7684\u5bf9\u8c61&#xff0c;C&#043;&#043; \u4e2d\u628a\u8fd9\u4e2a\u672a\u547d\u540d\u5bf9\u8c61\u53eb\u505a\u4e34\u65f6\u5bf9\u8c61\u3002<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int a &#061; 10;<\/p>\n<p>    const int&amp; ra &#061; 30;        \/\/\u5b57\u9762\u91cf \u2192 \u4e34\u65f6\u5bf9\u8c61<\/p>\n<p>    \/\/ \u7f16\u8bd1\u62a5\u9519: \u201c\u521d\u59cb\u5316\u201d: \u65e0\u6cd5\u4ece\u201cint\u201d\u8f6c\u6362\u4e3a\u201cint &amp;\u201d<br \/>\n    \/\/ int&amp; rb &#061; a * 3;<br \/>\n    const int&amp; rb &#061; a * 3;     \/\/\u8868\u8fbe\u5f0f\u7ed3\u679c \u2192 \u4e34\u65f6\u5bf9\u8c61<\/p>\n<p>    double d &#061; 12.34;<br \/>\n    \/\/ \u7f16\u8bd1\u62a5\u9519&#xff1a;\u201c\u521d\u59cb\u5316\u201d: \u65e0\u6cd5\u4ece\u201cdouble\u201d\u8f6c\u6362\u4e3a\u201cint &amp;\u201d<br \/>\n    \/\/ int&amp; rd &#061; d;<br \/>\n    const int&amp; rd &#061; d;         \/\/\u7c7b\u578b\u8f6c\u6362 \u2192 \u4e34\u65f6\u5bf9\u8c61<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n<h4>5.6\u00a0\u5f15\u7528\u548c\u6307\u9488\u7684\u5173\u7cfb<\/h4>\n<table>\n<tr>\u5bf9\u6bd4\u9879\u5f15\u7528\u6307\u9488<\/tr>\n<tbody>\n<tr>\n<td>\u8bed\u6cd5\u6982\u5ff5<\/td>\n<td>\u53d8\u91cf\u7684\u53d6\u522b\u540d&#xff0c;\u4e0d\u5f00\u7a7a\u95f4<\/td>\n<td>\u5b58\u50a8\u4e00\u4e2a\u53d8\u91cf\u5730\u5740&#xff0c;\u8981\u5f00\u7a7a\u95f4<\/td>\n<\/tr>\n<tr>\n<td>\u521d\u59cb\u5316<\/td>\n<td>\u5b9a\u4e49\u65f6\u5fc5\u987b\u521d\u59cb\u5316<\/td>\n<td>\u5efa\u8bae\u521d\u59cb\u5316&#xff0c;\u4f46\u8bed\u6cd5\u4e0a\u4e0d\u662f\u5fc5\u987b<\/td>\n<\/tr>\n<tr>\n<td>\u80fd\u5426\u6539\u6307\u5411<\/td>\n<td>\u5f15\u7528\u4e00\u4e2a\u5bf9\u8c61\u540e\u4e0d\u80fd\u518d\u5f15\u7528\u5176\u4ed6\u5bf9\u8c61<\/td>\n<td>\u53ef\u4ee5\u4e0d\u65ad\u5730\u6539\u53d8\u6307\u5411\u5bf9\u8c61<\/td>\n<\/tr>\n<tr>\n<td>\u8bbf\u95ee\u65b9\u5f0f<\/td>\n<td>\u76f4\u63a5\u8bbf\u95ee\u6307\u5411\u5bf9\u8c61<\/td>\n<td>\u9700\u8981\u89e3\u5f15\u7528\u624d\u662f\u8bbf\u95ee\u6307\u5411\u5bf9\u8c61<\/td>\n<\/tr>\n<tr>\n<td>sizeof \u542b\u4e49<\/td>\n<td>\u7ed3\u679c\u4e3a\u5f15\u7528\u7c7b\u578b\u7684\u5927\u5c0f<\/td>\n<td>\u59cb\u7ec8\u662f\u5730\u5740\u7a7a\u95f4\u6240\u5360\u5b57\u8282\u6570&#xff08;32 \u4f4d 4 \u5b57\u8282&#xff0c;64 \u4f4d 8 \u5b57\u8282&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u5b89\u5168\u6027<\/td>\n<td>\u6307\u9488\u5f88\u5bb9\u6613\u51fa\u73b0\u7a7a\u6307\u9488\u548c\u91ce\u6307\u9488\u95ee\u9898&#xff0c;\u5f15\u7528\u5f88\u5c11\u51fa\u73b0&#xff0c;\u5f15\u7528\u4f7f\u7528\u8d77\u6765\u76f8\u5bf9\u66f4\u5b89\u5168\u4e00\u4e9b<\/td>\n<td>\u2014<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u516d&#xff1a;\u5185\u8054\u51fd\u6570&#xff08;inline)<\/h3>\n<h4>6.1 \u5b9a\u4e49<\/h4>\n<p>\u7528 inline \u4fee\u9970\u7684\u51fd\u6570\u53eb\u505a\u5185\u8054\u51fd\u6570&#xff0c;\u7f16\u8bd1\u65f6 C&#043;&#043; \u7f16\u8bd1\u5668\u4f1a\u5728\u8c03\u7528\u7684\u5730\u65b9\u5c55\u5f00\u5185\u8054\u51fd\u6570&#xff0c;\u8fd9\u6837\u8c03\u7528\u5185\u8054\u51fd\u6570\u5c31\u4e0d\u9700\u8981\u5efa\u7acb\u6808\u5e27\u4e86&#xff0c;\u5c31\u53ef\u4ee5\u63d0\u9ad8\u6548\u7387\u3002<\/p>\n<p>inline int Add(int x, int y)<br \/>\n{<br \/>\n    int ret &#061; x &#043; y;<br \/>\n    ret &#043;&#061; 1;<br \/>\n    return ret;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int ret &#061; Add(1, 2);        \/\/ \u5c55\u5f00\u540e\u5927\u81f4\u76f8\u5f53\u4e8e&#xff1a;<br \/>\n                                \/\/ int x &#061; 1, y &#061; 2;<br \/>\n                                \/\/ int ret_tmp &#061; x &#043; y;<br \/>\n                                \/\/ ret_tmp &#043;&#061; 1;<br \/>\n                                \/\/ int ret &#061; ret_tmp;<br \/>\n    cout &lt;&lt; Add(1, 2) * 5 &lt;&lt; endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u4f18\u52bf&#xff1a;<\/p>\n<li>\u7701\u6389\u51fd\u6570\u8c03\u7528\u5f00\u9500&#xff08;\u538b\u6808\u3001\u8df3\u8f6c\u3001\u5efa\u6808\u5e27\u3001\u8fd4\u56de&#xff09;&#xff1b;<\/li>\n<li>\u8ba9\u7f16\u8bd1\u5668\u80fd\u505a\u8de8\u51fd\u6570\u7684\u4f18\u5316&#xff08;\u5e38\u91cf\u4f20\u64ad\u3001\u516c\u5171\u5b50\u8868\u8fbe\u5f0f\u6d88\u9664\u3001\u5bc4\u5b58\u5668\u5206\u914d\u7b49&#xff09;\u2014\u2014\u8fd9\u662f\u73b0\u4ee3\u7f16\u8bd1\u5668\u91cc inline \u7684\u66f4\u5927\u4ef7\u503c\u3002<\/li>\n<li>\u4f18\u5316\u540e\u7684\u7ed3\u679c\u5e38\u5e38\u662f\u7eaf\u5e38\u91cf\u8ba1\u7b97&#xff1a;<\/li>\n<h4>6.2\u00a0\u4e94\u4e2a\u6838\u5fc3\u7279\u70b9<\/h4>\n<h5>6.2.1\u00a0\u5b83\u53ea\u662f\u4e00\u4e2a&#034;\u5efa\u8bae&#034;&#xff0c;\u4e0d\u662f\u547d\u4ee4<\/h5>\n<p>inline \u5bf9\u4e8e\u7f16\u8bd1\u5668\u800c\u8a00\u53ea\u662f\u4e00\u4e2a\u5efa\u8bae&#xff0c;\u4e5f\u5c31\u662f\u8bf4&#xff0c;\u4f60\u52a0\u4e86 inline \u7f16\u8bd1\u5668\u4e5f\u53ef\u4ee5\u9009\u62e9\u5728\u8c03\u7528\u7684\u5730\u65b9\u4e0d\u5c55\u5f00&#xff0c;\u4e0d\u540c\u7f16\u8bd1\u5668\u5173\u4e8e inline \u4ec0\u4e48\u60c5\u51b5\u5c55\u5f00\u5404\u4e0d\u76f8\u540c&#xff0c;\u56e0\u4e3a C&#043;&#043; \u6807\u51c6\u6ca1\u6709\u89c4\u5b9a\u8fd9\u4e2a<\/p>\n<h5>6.2.2\u00a0\u53ea\u9002\u5408&#034;\u9891\u7e41\u8c03\u7528\u7684\u77ed\u5c0f\u51fd\u6570&#034;<\/h5>\n<p>inline \u9002\u7528\u4e8e\u9891\u7e41\u8c03\u7528\u7684\u77ed\u5c0f\u51fd\u6570&#xff0c;\u5bf9\u4e8e\u9012\u5f52\u51fd\u6570&#xff0c;\u4ee3\u7801\u76f8\u5bf9\u591a\u4e00\u4e9b\u7684\u51fd\u6570&#xff0c;\u52a0\u4e0a inline \u4e5f\u4f1a\u88ab\u7f16\u8bd1\u5668\u5ffd\u7565\u3002<\/p>\n<p>\u56e0\u4e3a\u5185\u8054\u662f\u7528\u4ee3\u7801\u4f53\u79ef\u6362\u901f\u5ea6&#xff1a;<\/p>\n<p>inline void Big(int x)      \/\/ 500 \u884c\u4ee3\u7801<br \/>\n{<br \/>\n    \/\/ &#8230; \u5927\u91cf\u903b\u8f91<br \/>\n}<br \/>\n\/\/ \u5728 100 \u4e2a\u5730\u65b9\u8c03\u7528 \u2192 \u4ee3\u7801\u4f53\u79ef\u66b4\u589e 100 \u500d<\/p>\n<h5>6.2.3\u00a0VS \u7684 Debug \u7248\u672c\u9ed8\u8ba4\u4e0d\u5c55\u5f00<\/h5>\n<p>vs \u7f16\u8bd1\u5668 debug \u7248\u672c\u4e0b\u9762\u9ed8\u8ba4\u662f\u4e0d\u5c55\u5f00 inline \u7684&#xff0c;\u8fd9\u6837\u65b9\u4fbf\u8c03\u8bd5&#xff0c;debug \u7248\u672c\u60f3\u5c55\u5f00\u9700\u8981\u8bbe\u7f6e\u4e00\u4e0b\u4ee5\u4e0b\u4e24\u4e2a\u5730\u65b9\u3002VS \u91cc\u6253\u5f00\u5185\u8054\u7684\u8bbe\u7f6e&#xff1a; \u9879\u76ee\u5c5e\u6027 \u2192 C\/C&#043;&#043; \u2192 \u4f18\u5316<\/p>\n<h5>6.2.4\u00a0\u00a0\u5b58\u5728\u7684\u76ee\u7684\u662f&#034;\u66ff\u4ee3 C \u7684\u5b8f\u51fd\u6570&#034;<\/h5>\n<p>C \u8bed\u8a00\u5b9e\u73b0\u5b8f\u51fd\u6570\u4e5f\u4f1a\u5728\u9884\u5904\u7406\u65f6\u66ff\u6362\u5c55\u5f00&#xff0c;\u4f46\u662f\u5b8f\u51fd\u6570\u5b9e\u73b0\u5f88\u590d\u6742\u5f88\u5bb9\u6613\u51fa\u9519\u7684&#xff0c;\u4e14\u4e0d\u65b9\u4fbf\u8c03\u8bd5<\/p>\n<p>\/\/ \u5b9e\u73b0\u4e00\u4e2a ADD \u5b8f\u51fd\u6570\u7684\u5e38\u89c1\u95ee\u9898<br \/>\n\/\/#define ADD(int a, int b) return a &#043; b;    \/\/ \u5b8f\u53c2\u6570\u4e0d\u80fd\u5e26\u7c7b\u578b&#xff01;\u5b8f\u662f\u6587\u672c\u66ff\u6362&#xff0c;\u4e0d\u662f\u51fd\u6570<br \/>\n\/\/#define ADD(a, b) a &#043; b;                   \/\/ \u6ca1\u6709\u62ec\u53f7&#xff0c;\u4f18\u5148\u7ea7\u5168\u4e71<br \/>\n\/\/#define ADD(a, b) (a &#043; b)                  \/\/ \u7f3a\u6bcf\u4e2a\u53c2\u6570\u5404\u81ea\u7684\u62ec\u53f7<\/p>\n<p>\/\/ \u6b63\u786e\u7684\u5b8f\u5b9e\u73b0<br \/>\n#define ADD(a, b) ((a) &#043; (b))<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int ret &#061; ADD(1, 2);<br \/>\n    cout &lt;&lt; ADD(1, 2) &lt;&lt; endl;<br \/>\n    cout &lt;&lt; ADD(1, 2)*5 &lt;&lt; endl;   \/\/\u7f3a\u5916\u5c42\u62ec\u53f7 \u2192 1 &#043; 2*5 &#061; 11&#xff08;\u9519&#xff01;&#xff09;<br \/>\n    int x &#061; 1, y &#061; 2;<br \/>\n    ADD(x &amp; y, x | y);             \/\/ -&gt; (x&amp;y&#043;x|y)  \u7f3a\u5185\u5c42\u62ec\u53f7 \u2192 \u4f18\u5148\u7ea7\u9519\u4e71<br \/>\n    return 0;<br \/>\n}<\/p>\n<h5>6.2.5\u00a0\u00a0\u4e0d\u5efa\u8bae\u58f0\u660e\u548c\u5b9a\u4e49\u5206\u79bb&#xff08;\u5426\u5219\u94fe\u63a5\u9519\u8bef&#xff09;<\/h5>\n<p>inline \u4e0d\u5efa\u8bae\u58f0\u660e\u548c\u5b9a\u4e49\u5206\u79bb\u5230\u4e24\u4e2a\u6587\u4ef6&#xff0c;\u5206\u79bb\u4f1a\u5bfc\u81f4\u94fe\u63a5\u9519\u8bef\u3002\u56e0\u4e3a inline \u88ab\u5c55\u5f00&#xff0c;\u5c31\u6ca1\u6709\u51fd\u6570\u5730\u5740&#xff0c;\u94fe\u63a5\u65f6\u4f1a\u51fa\u73b0\u62a5\u9519\u3002<\/p>\n<p>\/\/ F.h<br \/>\n#include &lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\ninline void f(int i);<\/p>\n<p>\/\/ F.cpp<br \/>\n#include &#034;F.h&#034;<br \/>\nvoid f(int i)<br \/>\n{<br \/>\n     cout &lt;&lt; i &lt;&lt; endl;<br \/>\n}<\/p>\n<p>\/\/ main.cpp<br \/>\n#include &#034;F.h&#034;<br \/>\nint main()<br \/>\n{<br \/>\n     \/\/ \u94fe\u63a5\u9519\u8bef&#xff1a;\u65e0\u6cd5\u89e3\u6790\u7684\u5916\u90e8\u7b26\u53f7<br \/>\n     f(10);<br \/>\n     return 0;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00&#xff1a;C\u517c\u5bb9C\u8bed\u2f94\u7edd\u2f24\u591a\u6570\u7684\u8bed\u6cd5&#xff0c;\u6240\u4ee5C\u8bed\u2f94\u5b9e\u73b0\u7684hello world\u4f9d\u65e7\u53ef\u4ee5\u8fd0\u2f8f&#xff0c;C\u4e2d\u9700\u8981\u628a\u5b9a\u4e49\u2f42\u4ef6 \u4ee3\u7801\u540e\u7f00\u6539\u4e3a.cpp&#xff0c;vs\u7f16\u8bd1\u5668\u770b\u5230\u662f.cpp\u5c31\u4f1a\u8c03\u2f64C\u7f16\u8bd1\u5668\u7f16\u8bd1\u4e00&#xff1a;\u547d\u540d\u7a7a\u95f4&#xff08;namespace&#xff09;1.\u4e3a\u4ec0\u4e48\u8981\u7528\u547d\u540d\u7a7a\u95f4\u5728C\/C\u4e2d&#xff0c;\u53d8\u91cf\u3001\u51fd\u6570\u548c\u540e\u2faf\u8981\u5b66\u5230\u7684\u7c7b\u90fd\u662f\u2f24\u91cf\u5b58\u5728\u7684&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u3001\u51fd\u6570\u548c\u7c7b\u7684\u540d\u79f0\u5c06\u90fd\u5b58\u5728\u4e8e\u5168\u5c40\u4f5c\u2f64\u57df\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4<\/p>\n","protected":false},"author":2,"featured_media":105371,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,371,190,124],"topic":[],"class_list":["post-105374","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-371","tag-190","tag-124"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>c++\u5165\u95e8 - \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\/105374.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"c++\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u524d\u8a00&#xff1a;C\u517c\u5bb9C\u8bed\u2f94\u7edd\u2f24\u591a\u6570\u7684\u8bed\u6cd5&#xff0c;\u6240\u4ee5C\u8bed\u2f94\u5b9e\u73b0\u7684hello world\u4f9d\u65e7\u53ef\u4ee5\u8fd0\u2f8f&#xff0c;C\u4e2d\u9700\u8981\u628a\u5b9a\u4e49\u2f42\u4ef6 \u4ee3\u7801\u540e\u7f00\u6539\u4e3a.cpp&#xff0c;vs\u7f16\u8bd1\u5668\u770b\u5230\u662f.cpp\u5c31\u4f1a\u8c03\u2f64C\u7f16\u8bd1\u5668\u7f16\u8bd1\u4e00&#xff1a;\u547d\u540d\u7a7a\u95f4&#xff08;namespace&#xff09;1.\u4e3a\u4ec0\u4e48\u8981\u7528\u547d\u540d\u7a7a\u95f4\u5728C\/C\u4e2d&#xff0c;\u53d8\u91cf\u3001\u51fd\u6570\u548c\u540e\u2faf\u8981\u5b66\u5230\u7684\u7c7b\u90fd\u662f\u2f24\u91cf\u5b58\u5728\u7684&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u3001\u51fd\u6570\u548c\u7c7b\u7684\u540d\u79f0\u5c06\u90fd\u5b58\u5728\u4e8e\u5168\u5c40\u4f5c\u2f64\u57df\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/105374.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-09-15T02:56:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915025621-6aa8b3d55a9c7.png\" \/>\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=\"10 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105374.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/105374.html\",\"name\":\"c++\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-09-15T02:56:23+00:00\",\"dateModified\":\"2026-09-15T02:56:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/105374.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/105374.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/105374.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"c++\u5165\u95e8\"}]},{\"@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++\u5165\u95e8 - \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\/105374.html","og_locale":"zh_CN","og_type":"article","og_title":"c++\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u524d\u8a00&#xff1a;C\u517c\u5bb9C\u8bed\u2f94\u7edd\u2f24\u591a\u6570\u7684\u8bed\u6cd5&#xff0c;\u6240\u4ee5C\u8bed\u2f94\u5b9e\u73b0\u7684hello world\u4f9d\u65e7\u53ef\u4ee5\u8fd0\u2f8f&#xff0c;C\u4e2d\u9700\u8981\u628a\u5b9a\u4e49\u2f42\u4ef6 \u4ee3\u7801\u540e\u7f00\u6539\u4e3a.cpp&#xff0c;vs\u7f16\u8bd1\u5668\u770b\u5230\u662f.cpp\u5c31\u4f1a\u8c03\u2f64C\u7f16\u8bd1\u5668\u7f16\u8bd1\u4e00&#xff1a;\u547d\u540d\u7a7a\u95f4&#xff08;namespace&#xff09;1.\u4e3a\u4ec0\u4e48\u8981\u7528\u547d\u540d\u7a7a\u95f4\u5728C\/C\u4e2d&#xff0c;\u53d8\u91cf\u3001\u51fd\u6570\u548c\u540e\u2faf\u8981\u5b66\u5230\u7684\u7c7b\u90fd\u662f\u2f24\u91cf\u5b58\u5728\u7684&#xff0c;\u8fd9\u4e9b\u53d8\u91cf\u3001\u51fd\u6570\u548c\u7c7b\u7684\u540d\u79f0\u5c06\u90fd\u5b58\u5728\u4e8e\u5168\u5c40\u4f5c\u2f64\u57df\u4e2d&#xff0c;\u53ef\u80fd\u4f1a\u5bfc\u81f4","og_url":"https:\/\/www.wsisp.com\/helps\/105374.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-09-15T02:56:23+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/09\/20260915025621-6aa8b3d55a9c7.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"10 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/105374.html","url":"https:\/\/www.wsisp.com\/helps\/105374.html","name":"c++\u5165\u95e8 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-09-15T02:56:23+00:00","dateModified":"2026-09-15T02:56:23+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/105374.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/105374.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/105374.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"c++\u5165\u95e8"}]},{"@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\/105374","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=105374"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/105374\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/105371"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=105374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=105374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=105374"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=105374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}