{"id":67375,"date":"2026-01-28T17:18:07","date_gmt":"2026-01-28T09:18:07","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/67375.html"},"modified":"2026-01-28T17:18:07","modified_gmt":"2026-01-28T09:18:07","slug":"c-%e7%b1%bb%e5%92%8c%e5%af%b9%e8%b1%a1%ef%bc%88%e4%ba%94%ef%bc%89%ef%bc%9a%e5%88%9d%e5%a7%8b%e5%8c%96%e5%88%97%e8%a1%a8%e3%80%81static%e3%80%81%e5%8f%8b%e5%85%83%e3%80%81%e5%86%85%e9%83%a8%e7%b1%bb","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/67375.html","title":{"rendered":"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565"},"content":{"rendered":"<p class=\"img-center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"80\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091757-6979d445e6bcb.png\" width=\"80\" \/><\/p>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091758-6979d446b956b.gif\" \/><\/p>\n<p>&#x1f525;\u4e2a\u4eba\u4e3b\u9875&#xff1a;\u5c0f\u5f20\u540c\u5b66<\/p>\n<p>&#x1f3ac;\u4f5c\u8005\u7b80\u4ecb&#xff1a;C&#043;&#043;\u7814\u53d1\u65b9\u5411\u5b66\u4e60\u8005<\/p>\n<p>&#x1f4d6;\u4e2a\u4eba\u4e13\u680f&#xff1a;\u00a0\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u300b\u300aC&#043;&#043;\u6df1\u5ea6\u5256\u6790&#xff1a;\u4ece\u5165\u95e8\u5230\u6df1\u8015\u300b<\/p>\n<p>\u2b50\ufe0f\u4eba\u751f\u683c\u8a00&#xff1a;\u65e0\u89c6\u4e2d\u65ad&#xff0c;\u4e0d\u5f03\u70ed\u6795&#xff0c;\u65b9\u5f97\u575a\u6301\u4e4b\u9053\u3002<\/p>\n<p><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091758-6979d446caa5b.png\" \/><\/p>\n<hr \/>\n<p id=\"%E5%89%8D%E8%A8%80%EF%BC%9A\">\u524d\u8a00&#xff1a;<\/p>\n<p>\u524d\u9762\u6211\u4eec\u5b66\u4e60\u5b8c\u4e866\u79cd\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u4ee5\u53caDate\u7c7b\u7684\u5b9e\u73b0\u3002\u4eca\u5929\u8fd9\u7bc7\u535a\u5ba2\u662f\u7c7b\u548c\u5bf9\u8c61\u7684\u6700\u540e\u4e00\u4e9b\u77e5\u8bc6&#xff0c;\u4e3b\u8981\u4f1a\u6d89\u53ca\u521d\u59cb\u5316\u5217\u8868\u3001\u7c7b\u578b\u8f6c\u6362\u3001static\u6210\u5458\u51fd\u6570&#xff0c;\u53cb\u5143\u3001\u533f\u540d\u5bf9\u8c61\u3001\u7f16\u8bd1\u5668\u7684\u4e00\u4e9b\u4f18\u5316\u3002\u901a\u8fc7\u672c\u7bc7\u535a\u6587\u548c\u4e4b\u524d\u7684\u535a\u6587&#xff0c;\u7c7b\u548c\u5bf9\u8c61\u5c31\u5b8c\u7ed3\u6492\u82b1\u4e86\u3002\u90a3\u6211\u4eec\u5c31\u8fdb\u5165\u5230\u7c7b\u548c\u5bf9\u8c61\u7684\u6536\u5b98\u4e4b\u6218\u5427~<\/p>\n<hr \/>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"%E4%B8%80%E3%80%81%E5%86%8D%E6%8E%A2%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:0px\">\u4e00\u3001\u518d\u63a2\u6784\u9020\u51fd\u6570<\/p>\n<p id=\"1.%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0%E4%BD%93%E5%86%85%E8%B5%8B%E5%80%BC%EF%BC%9A-toc\" style=\"margin-left:40px\">1.\u6784\u9020\u51fd\u6570\u4f53\u5185\u8d4b\u503c&#xff1a;<\/p>\n<p id=\"2.%E5%88%9D%E5%A7%8B%E5%8C%96%E5%88%97%E8%A1%A8%EF%BC%88%E9%87%8D%E7%82%B9%EF%BC%89%EF%BC%9A-toc\" style=\"margin-left:40px\">2.\u521d\u59cb\u5316\u5217\u8868&#xff08;\u91cd\u70b9&#xff09;&#xff1a;<\/p>\n<p id=\"3.%E5%88%9D%E5%A7%8B%E5%8C%96%E5%88%97%E8%A1%A8%E5%B0%8F%E7%BB%83%E4%B9%A0%EF%BC%9A-toc\" style=\"margin-left:40px\">3.\u521d\u59cb\u5316\u5217\u8868\u5c0f\u7ec3\u4e60&#xff1a;<\/p>\n<p id=\"%E4%BA%8C%E3%80%81%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2-toc\" style=\"margin-left:0px\">\u4e8c\u3001\u7c7b\u578b\u8f6c\u6362<\/p>\n<p id=\"%E4%B8%89%E3%80%81static%E6%88%90%E5%91%98-toc\" style=\"margin-left:0px\">\u4e09\u3001static\u6210\u5458<\/p>\n<p id=\"1.%E7%BB%83%E4%B9%A0%E9%A2%981%EF%BC%9A-toc\" style=\"margin-left:40px\">1.\u7ec3\u4e60\u98981&#xff1a;<\/p>\n<p id=\"2.%E7%BB%83%E4%B9%A0%E9%A2%982%EF%BC%9A-toc\" style=\"margin-left:40px\">2.\u7ec3\u4e60\u98982&#xff1a;<\/p>\n<p id=\"%E5%9B%9B%E3%80%81%E5%8F%8B%E5%85%83-toc\" style=\"margin-left:0px\">\u56db\u3001\u53cb\u5143<\/p>\n<p id=\"1.%E5%8F%8B%E5%85%83%E5%87%BD%E6%95%B0%EF%BC%9A-toc\" style=\"margin-left:40px\">1.\u53cb\u5143\u51fd\u6570&#xff1a;<\/p>\n<p id=\"2.%E5%8F%8B%E5%85%83%E7%B1%BB%EF%BC%9A-toc\" style=\"margin-left:40px\">2.\u53cb\u5143\u7c7b&#xff1a;<\/p>\n<p id=\"%E4%BA%94%E3%80%81%E5%86%85%E9%83%A8%E7%B1%BB-toc\" style=\"margin-left:0px\">\u4e94\u3001\u5185\u90e8\u7c7b<\/p>\n<p id=\"%E5%85%AD%E3%80%81%E5%8C%BF%E5%90%8D%E5%AF%B9%E8%B1%A1-toc\" style=\"margin-left:0px\">\u516d\u3001\u533f\u540d\u5bf9\u8c61<\/p>\n<p id=\"%E4%B8%83%E3%80%81%E5%AF%B9%E8%B1%A1%E6%8B%B7%E8%B4%9D%E6%97%B6%E7%9A%84%E7%BC%96%E8%AF%91%E5%99%A8%E4%BC%98%E5%8C%96-toc\" style=\"margin-left:0px\">\u4e03\u3001\u5bf9\u8c61\u62f7\u8d1d\u65f6\u7684\u7f16\u8bd1\u5668\u4f18\u5316<\/p>\n<hr \/>\n<h2 id=\"%E4%B8%80%E3%80%81%E5%86%8D%E6%8E%A2%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0\" style=\"background-color:transparent\">\u4e00\u3001\u518d\u63a2\u6784\u9020\u51fd\u6570<\/h2>\n<h3 id=\"1.%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0%E4%BD%93%E5%86%85%E8%B5%8B%E5%80%BC%EF%BC%9A\" style=\"background-color:transparent\">1.\u6784\u9020\u51fd\u6570\u4f53\u5185\u8d4b\u503c&#xff1a;<\/h3>\n<p>\u4e4b\u524d\u6211\u4eec\u5728\u521b\u5efa\u5bf9\u8c61\u65f6&#xff0c;\u7f16\u8bd1\u5668\u901a\u8fc7\u8c03\u7528\u6211\u4eec\u5b9a\u4e49\u7684\u6784\u9020\u51fd\u6570&#xff0c;\u7ed9\u5bf9\u8c61\u4e2d\u5404\u4e2a\u6210\u5458\u53d8\u91cf\u8d4b\u4e88\u4e00\u4e2a\u5408\u9002\u7684\u521d\u59cb\u503c\u3002<\/p>\n<p>class Date<br \/>\n{<br \/>\npublic:<br \/>\n\/\/ \u6784\u9020\u51fd\u6570<br \/>\nDate(int year &#061; 0, int month &#061; 1, int day &#061; 1)<br \/>\n{<br \/>\n\/\/\u5b9e\u9645\u4e0a\u662f\u8d4b\u503c&#xff0c;\u5e76\u975e\u4e25\u683c\u610f\u4e49\u4e0a\u7684\u521d\u59cb\u5316<br \/>\n_year &#061; year;<br \/>\n_month &#061; month;<br \/>\n_day &#061; day;<br \/>\n}<br \/>\nprivate:<br \/>\nint _year;<br \/>\nint _month;<br \/>\nint _day;<br \/>\n}; <\/p>\n<p>\u9700\u8981\u6ce8\u610f\u7684\u662f&#xff1a;\u00a0\u867d\u7136\u901a\u8fc7\u8c03\u7528\u4e0a\u8ff0\u7684\u6784\u9020\u51fd\u6570\u540e&#xff0c;\u5bf9\u8c61\u4e2d\u7684\u6bcf\u4e2a\u6210\u5458\u53d8\u91cf\u90fd\u6709\u4e86\u4e00\u4e2a\u521d\u59cb\u503c&#xff0c;\u4f46\u662f\u6784\u9020\u51fd\u6570\u4e2d\u7684\u8bed\u53e5\u53ea\u80fd\u5c06\u5176\u79f0\u4f5c\u4e3a\u8d4b\u521d\u503c&#xff0c;\u800c\u4e0d\u80fd\u79f0\u4f5c\u4e3a\u521d\u59cb\u5316\u3002\u56e0\u4e3a\u521d\u59cb\u5316\u53ea\u80fd\u521d\u59cb\u5316\u4e00\u6b21&#xff0c;\u800c\u6784\u9020\u51fd\u6570\u4f53\u5185\u53ef\u4ee5\u8fdb\u884c\u591a\u6b21\u8d4b\u503c\u3002<\/p>\n<p>class Date<br \/>\n{<br \/>\npublic:<br \/>\n\/\/ \u6784\u9020\u51fd\u6570<br \/>\nDate(int year &#061; 0, int month &#061; 1, int day &#061; 1)<br \/>\n{<br \/>\n_year &#061; year;\/\/ \u7b2c\u4e00\u6b21\u8d4b\u503c<br \/>\n_year &#061; 2022;\/\/ \u7b2c\u4e8c\u6b21\u8d4b\u503c<br \/>\n\/\/&#8230;<br \/>\n_month &#061; month;<br \/>\n_day &#061; day;<br \/>\n}<br \/>\nprivate:<br \/>\nint _year;<br \/>\nint _month;<br \/>\nint _day;<br \/>\n};<\/p>\n<h3 id=\"2.%E5%88%9D%E5%A7%8B%E5%8C%96%E5%88%97%E8%A1%A8%EF%BC%88%E9%87%8D%E7%82%B9%EF%BC%89%EF%BC%9A\" style=\"background-color:transparent\">2.\u521d\u59cb\u5316\u5217\u8868&#xff08;\u91cd\u70b9&#xff09;&#xff1a;<\/h3>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u4e4b\u524d\u6211\u4eec\u5b9e\u73b0\u6784\u9020\u51fd\u6570\u65f6&#xff0c;\u521d\u59cb\u5316\u6210\u5458\u53d8\u91cf\u4e3b\u8981\u4f7f\u7528\u51fd\u6570\u4f53\u5185\u8d4b\u503c&#xff0c;\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u8fd8\u6709\u4e00\u79cd\u65b9\u5f0f&#xff0c;\u5c31\u662f\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u521d\u59cb\u5316\u5217\u8868\u7684\u4f7f\u7528\u65b9\u5f0f\u662f\u4ee5\u4e00\u4e2a\u5192\u53f7\u5f00\u59cb&#xff0c;\u63a5\u7740\u662f\u4e00\u4e2a\u4ee5\u9017\u53f7\u5206\u9694\u7684\u6570\u636e\u6210\u5458\u5217\u8868&#xff0c;\u6bcf\u4e2a&#034;\u6210\u5458\u53d8\u91cf&#034;\u540e\u9762\u8ddf\u4e00\u4e2a\u653e\u5728\u62ec\u53f7\u4e2d\u7684\u521d\u59cb\u503c\u6216\u8868\u8fbe\u5f0f\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u6bcf\u4e2a\u6210\u5458\u53d8\u91cf\u5728\u521d\u59cb\u5316\u5217\u8868\u4e2d\u53ea\u80fd\u51fa\u73b0\u4e00\u6b21&#xff0c;\u8bed\u6cd5\u7406\u89e3\u4e0a\u521d\u59cb\u5316\u5217\u8868\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6bcf\u4e2a\u6210\u5458\u53d8\u91cf\u5b9a\u4e49\u521d\u59cb\u5316\u7684\u5730\u65b9\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5f15\u7528\u6210\u5458\u53d8\u91cf&#xff0c;const\u6210\u5458\u53d8\u91cf&#xff0c;\u6ca1\u6709\u9ed8\u8ba4\u6784\u9020\u7684\u7c7b\u7c7b\u578b\u53d8\u91cf&#xff0c;\u5fc5\u987b\u653e\u5728\u521d\u59cb\u5316\u5217\u8868\u4f4d\u7f6e\u8fdb\u884c\u521d\u59cb\u5316&#xff0c;\u5426\u5219\u4f1a\u7f16\u8bd1\u62a5\u9519\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">C&#043;&#043;11\u652f\u6301\u5728\u6210\u5458\u53d8\u91cf\u58f0\u660e\u7684\u4f4d\u7f6e\u7ed9\u7f3a\u7701\u503c&#xff0c;\u8fd9\u4e2a\u7f3a\u7701\u503c\u4e3b\u8981\u662f\u7ed9\u6ca1\u6709\u663e\u793a\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316\u7684\u6210\u5458\u4f7f\u7528\u7684\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5c3d\u91cf\u4f7f\u7528\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316&#xff0c;\u56e0\u4e3a\u90a3\u4e9b\u4f60\u4e0d\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316\u7684\u6210\u5458\u4e5f\u4f1a\u8d70\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u5982\u679c\u8fd9\u4e2a\u6210\u5458\u5728\u58f0\u660e\u4f4d\u7f6e\u7ed9\u4e86\u7f3a\u7701\u503c&#xff0c;\u521d\u59cb\u5316\u5217\u8868\u4f1a\u7528\u8fd9\u4e2a\u7f3a\u7701\u503c\u521d\u59cb\u5316\u3002\u5982\u679c\u4f60\u6ca1\u6709\u7ed9\u7f3a\u7701\u503c&#xff0c;\u5bf9\u4e8e\u6ca1\u6709\u663e\u793a\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316\u7684\u5185\u7f6e\u7c7b\u578b\u6210\u5458\u662f\u5426\u521d\u59cb\u5316\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668&#xff0c;C&#043;&#043;\u5e76\u6ca1\u6709\u89c4\u5b9a\u3002\u5bf9\u4e8e\u6ca1\u6709\u663e\u793a\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316\u7684\u81ea\u5b9a\u4e49\u7c7b\u578b\u6210\u5458\u4f1a\u8c03\u7528\u8fd9\u4e2a\u6210\u5458\u7c7b\u578b\u7684\u9ed8\u8ba4\u6784\u9020\u51fd\u6570&#xff0c;\u5982\u679c\u6ca1\u6709\u9ed8\u8ba4\u6784\u9020\u4f1a\u7f16\u8bd1\u9519\u8bef\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u521d\u59cb\u5316\u5217\u8868\u4e2d\u6309\u7167\u6210\u5458\u53d8\u91cf\u5728\u7c7b\u4e2d\u58f0\u660e\u987a\u5e8f\u8fdb\u884c\u521d\u59cb\u5316&#xff0c;\u8ddf\u6210\u5458\u5728\u521d\u59cb\u5316\u5217\u8868\u51fa\u73b0\u7684\u7684\u5148\u540e\u987a\u5e8f\u65e0\u5173\u3002\u5efa\u8bae\u58f0\u660e\u987a\u5e8f\u548c\u521d\u59cb\u5316\u5217\u8868\u987a\u5e8f\u4fdd\u6301\u4e00\u81f4\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u7528\u4ee3\u7801\u6765\u8bf4\u660e\u6bcf\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<p>\u57fa\u7840\u7528\u6cd5&#xff1a;<\/p>\n<p>class Date<br \/>\n{<br \/>\npublic:<br \/>\n\/\/ \u6784\u9020\u51fd\u6570<br \/>\nDate(int year &#061; 1, int month &#061; 1, int day &#061; 1)<br \/>\n:_year(year)<br \/>\n, _month(month)<br \/>\n, _day(day)<br \/>\n{<br \/>\n        \/\/&#8230;<br \/>\n    }<br \/>\nprivate:<br \/>\nint _year;<br \/>\nint _month;<br \/>\nint _day;<br \/>\n};<\/p>\n<p>\u5fc5\u987b\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316\u7684\u60c5\u51b5&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class Time<br \/>\n{<br \/>\npublic:<br \/>\nTime(int hour)<br \/>\n:_hour(hour)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;Time()&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\nint _hour;<br \/>\n};<\/p>\n<p>class Date<br \/>\n{<br \/>\npublic:<br \/>\nDate(int&amp; ref, int year &#061; 1, int month &#061; 1, int day &#061; 1)<br \/>\n:_year(year)<br \/>\n,_month(month)<br \/>\n,_day(day)<br \/>\n,_t(12)<br \/>\n,_ref(ref)<br \/>\n,_n(1)<br \/>\n{<br \/>\n\/\/ error C2512: \u201cTime\u201d: \u6ca1\u6709\u5408\u9002\u7684\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u53ef\u7528<br \/>\n\/\/ error C2530 : \u201cDate::_ref\u201d : \u5fc5\u987b\u521d\u59cb\u5316\u5f15\u7528<br \/>\n\/\/ error C2789 : \u201cDate::_n\u201d : \u5fc5\u987b\u521d\u59cb\u5316\u5e38\u91cf\u9650\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61<br \/>\n}<br \/>\nvoid Print() const<br \/>\n{<br \/>\ncout &lt;&lt; _year &lt;&lt; &#034;-&#034; &lt;&lt; _month &lt;&lt; &#034;-&#034; &lt;&lt; _day &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\nint _year;<br \/>\nint _month;<br \/>\nint _day;<\/p>\n<p>\/\/\u4ee5\u4e0b\u8fd9\u4e09\u4e2a\u5c31\u662f\u5fc5\u987b\u8981\u5728\u521d\u59cb\u5316\u5217\u8868\u4e2d\u521d\u59cb\u5316\u7684<br \/>\n\/\/\u5fc5\u987b\u521d\u59cb\u5316\u7684\u90fd\u9700\u8981\u5728\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316&#xff0c;\u8981\u4e48\u5c31\u7ed9\u7f3a\u7701\u503c<br \/>\n\/\/\u4e0d\u7ed9\u5c31\u4f1a\u62a5\u4e0a\u9762\u7684\u90a3\u4e9b\u9519\u8bef<\/p>\n<p>Time _t; \/\/ \u6ca1\u6709\u9ed8\u8ba4\u6784\u9020<br \/>\nint&amp; _ref; \/\/ \u5f15\u7528<br \/>\nconst int _n; \/\/ const<\/p>\n<p>};<\/p>\n<p>int main()<br \/>\n{<br \/>\nint a &#061; 0;<br \/>\nDate d1(a);<br \/>\nd1.Print();<br \/>\nreturn 0;<br \/>\n} <\/p>\n<p><span style=\"color:#333333\">\u7528\u521d\u59cb\u5316\u5217\u8868\u89e3\u51b3\u81ea\u5b9a\u4e49\u7c7b\u578b&#xff08;\u5982<\/span>MyQueue\u7c7b<span style=\"color:#333333\">&#xff09;\u7684\u4e00\u4e9b\u95ee\u9898&#xff1a;<\/span><\/p>\n<p>\/\/\u901a\u8fc7\u4e0a\u9762\u7684\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u6211\u4eec\u4e4b\u524dMyQueue\u7c7b\u7684\u4e00\u4e9b\u95ee\u9898\u4e5f\u53ef\u4ee5\u5f97\u5230\u89e3\u51b3<br \/>\n\/\/\u8fd9\u91cc\u5c31\u5927\u6982\u5b9e\u73b0\u4e00\u90e8\u5206&#xff0c;\u4ec5\u4f5c\u4e3a\u6f14\u793a\u4f7f\u7528<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\nclass Stack<br \/>\n{<br \/>\npublic:<br \/>\nStack(int n)\/\/\u8fd9\u91cc\u7ed9\u7684\u4e0d\u662f\u9ed8\u8ba4\u6784\u9020<br \/>\n{<br \/>\ncout &lt;&lt; &#034;Stack(int n)&#034; &lt;&lt; &#039;\\\\n&#039;;<br \/>\n}<br \/>\n};<\/p>\n<p>class MyQueue<br \/>\n{<br \/>\npublic:<br \/>\n\/\/\u5f53\u4e0d\u5199MyQueue\u7684\u6784\u9020\u51fd\u6570\u65f6&#xff0c;\u4f1a\u81ea\u52a8\u8c03\u7528Stack\u7684\u6784\u9020\u6765\u521d\u59cb\u5316<br \/>\n\/\/\u4f46\u662f\u5982\u679cStack\u6ca1\u6709\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u600e\u4e48\u529e&#xff1f;<br \/>\n\/\/\u5982\u679c\u4ecd\u7136\u8c03\u7528MyQueue\u9ed8\u8ba4\u7684\u6784\u9020\u51fd\u6570\u4f1a\u62a5\u9519<br \/>\n\/\/MyQueue(int n &#061; 4)<br \/>\n\/\/{<br \/>\n\/\/_st1 &#061; n;<br \/>\n\/\/  _st2 &#061; n;<br \/>\n\/\/\/\/\u8fd9\u91cc\u5982\u679c\u76f4\u63a5\u8fd9\u6837\u5199\u662f\u9519\u8bef\u7684&#xff0c;\u65e0\u6cd5\u8fdb\u884c\u8d4b\u503c<br \/>\n\/\/}<\/p>\n<p>\/\/\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u521d\u59cb\u5316\u5217\u8868\u6709\u6548\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898<br \/>\nMyQueue(int n &#061; 4)<br \/>\n:_st1(n)<br \/>\n,_st2(n)\/\/\u8fd9\u91cc\u5c31\u4e0d\u662f\u8d4b\u503c\u4e86&#xff0c;\u662f\u521d\u59cb\u5316&#xff0c;\u5c31\u53ef\u4ee5\u8fdb\u5165\u5230\u81ea\u5b9a\u4e49\u7684\u6784\u9020\u51fd\u6570<br \/>\n{<br \/>\n\/\/&#8230;<br \/>\n}<br \/>\nprivate:<br \/>\nStack _st1;<br \/>\nStack _st2;<br \/>\n};<br \/>\nint main()<br \/>\n{<br \/>\nMyQueue q1;<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p>\u5728\u6210\u5458\u53d8\u91cf\u58f0\u660e\u65f6\u5229\u7528\u7f3a\u7701\u503c\u8fdb\u884c\u521d\u59cb\u5316&#xff1a;<\/p>\n<p>\/\/\u5176\u5b9e\u9664\u4e86\u521d\u59cb\u5316\u5217\u8868\u4ee5\u5916&#xff0c;\u6211\u4eec\u8fd8\u53ef\u4ee5\u8fd9\u6837\u73a9<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class Time<br \/>\n{<br \/>\npublic:<br \/>\nTime(int hour)<br \/>\n:_hour(hour)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;Time()&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\nint _hour;<br \/>\n};<br \/>\nclass Date<br \/>\n{<br \/>\npublic:<br \/>\nDate()<br \/>\n:_year(100)<br \/>\n{<\/p>\n<p>}<br \/>\nvoid Print() const<br \/>\n{<br \/>\ncout &lt;&lt; _year &lt;&lt; &#034;-&#034; &lt;&lt; _month &lt;&lt; &#034;-&#034; &lt;&lt; _day &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\n\/\/\u6ce8\u610f:\u8fd9\u91cc\u4e0d\u662f\u521d\u59cb\u5316&#xff0c;\u800c\u662f\u7ed9\u7684\u7f3a\u7701\u503c&#xff0c;\u8fd9\u4e2a\u7f3a\u7701\u503c\u662f\u7ed9\u521d\u59cb\u5316\u5217\u8868\u7684<br \/>\n\/\/\u6bcf\u4e2a\u6210\u5458\u53d8\u91cf\u90fd\u4f1a\u8d70\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u5982\u679c\u672a\u663e\u793a\u5728\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u5219\u4f1a\u6309\u7f3a\u7701\u503c\u521d\u59cb\u5316<br \/>\n\/\/\u5982\u679c\u90fd\u6ca1\u6709&#xff0c;\u90a3\u5185\u7f6e\u7c7b\u578b\u53ef\u80fd\u5c31\u662f\u968f\u673a\u503c&#xff0c;\u4e4b\u524d\u63d0\u5230\u8fc7\u7684\u90a3\u4e09\u79cd\u5c31\u662f\u76f4\u63a5\u62a5\u9519<br \/>\nint _year &#061; 1;<br \/>\nint _month &#061; 1;<br \/>\nint _day&#061;1;<\/p>\n<p>Time _t &#061; 1;\/\/ \u6ca1\u6709\u9ed8\u8ba4\u6784\u9020<br \/>\nconst int _n &#061; 1; \/\/ const<br \/>\nint* _ptr &#061; (int*)malloc(40);\/\/\u6570\u7ec4\u4e5f\u53ef\u4ee5<br \/>\n};<\/p>\n<p>int main()<br \/>\n{<br \/>\nDate d1;<br \/>\nd1.Print();<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p><span style=\"color:#fe2c24\">\u90a3\u4e48\u90fd\u6709\u521d\u59cb\u5316\u5217\u8868\u4e86&#xff0c;\u4e3a\u4ec0\u4e48\u8fd8\u7559\u7740\u51fd\u6570\u4f53\u5185\u90a3\u4e00\u90e8\u5206\u5462&#xff1f;<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u603b\u7ed3\u5c31\u662f\u5728\u51fd\u6570\u4f53\u5185\u8fd8\u8981\u8fdb\u884c\u68c0\u67e5\u3001\u4ee5\u53ca\u5c06\u7a7a\u95f4\u521d\u59cb\u5316\u989d\u64cd\u4f5c\u7b49&#xff0c;\u89c1\u5982\u4e0b\u4ee3\u7801<\/span><\/p>\n<p>\/\/\u90a3\u4e3a\u4ec0\u4e48\u90fd\u4f7f\u7528\u4e86\u521d\u59cb\u5316\u5217\u8868\u4e86&#xff0c;\u8fd8\u9700\u8981\u90a3\u4e2a\u62ec\u53f7\u5462<br \/>\n\/\/\u6211\u4eec\u6765\u770b\u770b\u4e0b\u9762\u8fd9\u4e2a\u573a\u666f<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\nclass A<br \/>\n{<br \/>\npublic:<br \/>\nA(int n &#061; 10)<br \/>\n:_a((int*)malloc(sizeof(int)* n))<br \/>\n, _size(0)<br \/>\n{<br \/>\n\/\/\u4e0a\u9762\u7684_a\u7684\u7a7a\u95f4\u662f\u5426\u5f00\u8f9f\u6210\u529f\u662f\u4e0d\u662f\u9700\u8981\u5728\u8fd9\u91cc\u68c0\u67e5<br \/>\n\/\/\u4ee5\u53ca\u7ed9\u7a7a\u95f4\u521d\u59cb\u5316\u662f\u4e0d\u662f\u4e5f\u5f97\u5728\u8fd9\u91cc\u5b9e\u73b0<br \/>\nif (_a &#061;&#061; nullptr)<br \/>\n{<br \/>\nperror(&#034;malloc fail!&#034;);<br \/>\nexit(1);<br \/>\n}<br \/>\nmemset(_a, 0, sizeof(int) * n);<br \/>\n}<br \/>\nprivate:<br \/>\nint* _a;<br \/>\nint _size;<br \/>\n};<br \/>\nint main()<br \/>\n{<br \/>\nA aa;<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p><span style=\"color:#1f2329\">\u521d\u59cb\u5316\u5217\u8868\u603b\u7ed3&#xff1a; <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u65e0\u8bba\u662f\u5426\u663e\u793a\u5199\u521d\u59cb\u5316\u5217\u8868&#xff0c;\u6bcf\u4e2a\u6784\u9020\u51fd\u6570\u90fd\u6709\u521d\u59cb\u5316\u5217\u8868&#xff1b; <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u65e0\u8bba\u662f\u5426\u5728\u521d\u59cb\u5316\u5217\u8868\u663e\u793a\u521d\u59cb\u5316\u6210\u5458\u53d8\u91cf&#xff0c;\u6bcf\u4e2a\u6210\u5458\u53d8\u91cf\u90fd\u8981\u8d70\u521d\u59cb\u5316\u5217\u8868\u521d\u59cb\u5316&#xff1b;<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1038\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091800-6979d448691d1.png\" width=\"2502\" \/><\/p>\n<h3 id=\"3.%E5%88%9D%E5%A7%8B%E5%8C%96%E5%88%97%E8%A1%A8%E5%B0%8F%E7%BB%83%E4%B9%A0%EF%BC%9A\" style=\"background-color:transparent\">3.\u521d\u59cb\u5316\u5217\u8868\u5c0f\u7ec3\u4e60&#xff1a;<\/h3>\n<p><span style=\"color:#1f2329\">\u4e0b\u9762\u7a0b\u5e8f\u7684\u8fd0\u884c\u7ed3\u679c\u662f\u4ec0\u4e48&#xff08;&#xff09; <\/span><\/p>\n<p><span style=\"color:#1f2329\">A. \u8f93\u51fa 1 1 <\/span><\/p>\n<p><span style=\"color:#1f2329\">B. \u8f93\u51fa 2 2 <\/span><\/p>\n<p><span style=\"color:#1f2329\">C. \u7f16\u8bd1\u62a5\u9519 <\/span><\/p>\n<p><span style=\"color:#1f2329\">D. \u8f93\u51fa 1 \u968f\u673a\u503c <\/span><\/p>\n<p><span style=\"color:#1f2329\">E. \u8f93\u51fa 1 2 <\/span><\/p>\n<p><span style=\"color:#1f2329\">F. \u8f93\u51fa 2 1<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"966\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091801-6979d449c8e2b.png\" width=\"1053\" \/><\/p>\n<p>\u7b54\u6848&#xff1a;<span style=\"color:#fe2c24\">D<\/span><\/p>\n<p><span style=\"color:#0d0016\">\u89e3\u6790&#xff1a;<\/span><span style=\"color:#1f2329\">\u521d\u59cb\u5316\u5217\u8868\u4e2d\u6309\u7167\u6210\u5458\u53d8\u91cf\u5728\u7c7b\u4e2d\u58f0\u660e\u987a\u5e8f\u8fdb\u884c\u521d\u59cb\u5316&#xff0c;\u8ddf\u6210\u5458\u5728\u521d\u59cb\u5316\u5217\u8868\u51fa\u73b0\u7684\u7684\u5148\u540e\u987a\u5e8f\u65e0\u5173\u3002\u5efa\u8bae\u58f0\u660e\u987a\u5e8f\u548c\u521d\u59cb\u5316\u5217\u8868\u987a\u5e8f\u4fdd\u6301\u4e00\u81f4&#xff0c;\u4ee5\u514d\u7c7b\u4f3c\u9519\u8bef\u3002<\/span><\/p>\n<p> \/\/\u6211\u4eec\u6700\u540e\u518d\u6765\u770b\u4e2a\u9898<br \/>\n\/\/\u6ce8\u610f_a1,_a2\u8c01\u5148\u521d\u59cb\u5316&#xff0c;\u4ee5\u53ca\u6700\u540e\u7ed3\u679c\u662f\u4ec0\u4e48<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\nclass A<br \/>\n{<br \/>\n\/\/\u521d\u59cb\u5316\u987a\u5e8f\u8ddf\u51fa\u73b0\u5728\u521d\u59cb\u5316\u5217\u8868\u7684\u987a\u5e8f\u65e0\u5173&#xff0c;\u53d6\u51b3\u4e8e\u58f0\u660e\u7684\u987a\u5e8f<br \/>\n    \/\/\u6240\u4ee5\u8fd9\u91cc\u5176\u5b9e\u662f_a2\u5148\u521d\u59cb\u5316&#xff0c;_a1\u518d\u521d\u59cb\u5316<br \/>\npublic:<br \/>\nA(int a)<br \/>\n:_a1(a)<br \/>\n,_a2(_a1)<br \/>\n{<br \/>\n\/\/_a2\u5148\u521d\u59cb\u5316&#xff0c;\u6b64\u65f6_a1\u8fd8\u6ca1\u521d\u59cb\u5316&#xff0c;\u6240\u4ee5\u662f\u968f\u673a\u503c&#xff0c;\u6700\u540e_a2\u4e5f\u5c31\u662f\u968f\u673a\u503c\u4e86<br \/>\n\/\/_a1\u518d\u521d\u59cb\u5316,\u7f3a\u7701\u503c\u548c\u521d\u59cb\u5316\u5217\u8868\u663e\u793a\u51fa\u73b0\u7b26\u5408&#xff0c;\u6309\u521d\u59cb\u5316\u5217\u8868\u7684\u6765&#xff0c;\u4e5f\u5c31\u662f1\u3002<br \/>\n}<br \/>\nvoid Print()<br \/>\n    {<br \/>\ncout &lt;&lt; _a1 &lt;&lt; &#034; &#034; &lt;&lt; _a2 &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\n\/\/\u521d\u59cb\u5316\u5217\u8868\u6309\u7167\u6210\u5458\u53d8\u91cf\u5728\u7c7b\u4e2d\u7684\u58f0\u660e\u987a\u5e8f\u521d\u59cb\u5316<br \/>\n\/\/\u8fd9\u91cc\u6211\u4eec\u53d1\u73b0_a2\u5148\u58f0\u660e<br \/>\nint _a2 &#061; 2;<br \/>\nint _a1 &#061; 2;<br \/>\n};<br \/>\nint main()<br \/>\n{<br \/>\nA aa(1);<br \/>\naa.Print();\/\/1 \u968f\u673a\u503c<br \/>\n} <\/p>\n<hr \/>\n<h2 id=\"%E4%BA%8C%E3%80%81%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2\" style=\"background-color:transparent\">\u4e8c\u3001\u7c7b\u578b\u8f6c\u6362<\/h2>\n<p>\u6211\u4eec\u4e4b\u524d\u63a5\u89e6\u8fc7\u5185\u7f6e\u7c7b\u578b\u548c\u5185\u7f6e\u7c7b\u578b\u4e4b\u524d\u7684\u8f6c\u6362&#xff08;\u6709\u9690\u5f0f\u8f6c\u6362\u3001\u663e\u793a\u8f6c\u6362&#xff09;&#xff0c;\u90a3\u4e48\u6211\u4eec\u73b0\u5728\u518d\u6765\u770b\u770b\u5185\u7f6e\u7c7b\u578b\u548c\u7c7b\u7c7b\u578b&#xff0c;\u7c7b\u7c7b\u578b\u4e4b\u95f4\u7684\u8f6c\u6362&#xff1a;<\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">C&#043;&#043;\u652f\u6301\u5185\u7f6e\u7c7b\u578b\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u4e3a\u7c7b\u7c7b\u578b\u5bf9\u8c61&#xff0c;\u9700\u8981\u6709\u76f8\u5173\u5185\u7f6e\u7c7b\u578b\u4e3a\u53c2\u6570\u7684\u6784\u9020\u51fd\u6570\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u6784\u9020\u51fd\u6570\u524d\u9762\u52a0explicit\u5c31\u4e0d\u518d\u652f\u6301\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u7c7b\u7c7b\u578b\u7684\u5bf9\u8c61\u4e4b\u95f4\u4e5f\u53ef\u4ee5\u9690\u5f0f\u8f6c\u6362&#xff0c;\u9700\u8981\u76f8\u5e94\u7684\u6784\u9020\u51fd\u6570\u652f\u6301\u3002<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"378\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091802-6979d44a8f52f.png\" width=\"945\" \/><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u4f9d\u7136\u7528\u4ee3\u7801\u6765\u8fdb\u4e00\u6b65\u8bf4\u660e\u6bcf\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<p>\u57fa\u672c\u4f7f\u7528&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\nclass A<br \/>\n{<br \/>\npublic:<br \/>\n\/\/\u6784\u9020\u51fd\u6570explicit\u5c31\u4e0d\u518d\u652f\u6301\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u4e86<br \/>\n\/\/explict A(int a1)<br \/>\n\/\/\u8fd9\u91cc\u7684\u6784\u9020\u51fd\u6570\u53c2\u6570\u6709\u76f8\u5173\u5185\u7f6e\u7c7b\u578b<br \/>\nA(int a1)<br \/>\n:_a1(a1)<br \/>\n{<br \/>\n}<br \/>\nprivate:<br \/>\nint _a1 &#061; 1;<br \/>\nint _a2 &#061; 2;<br \/>\n};<\/p>\n<p>void func(const A&amp; aa &#061; 1)<br \/>\n{<\/p>\n<p>}<\/p>\n<p>class Stack<br \/>\n{<br \/>\npublic:<br \/>\nvoid Push(const A&amp; a)<br \/>\n{<\/p>\n<p>}<\/p>\n<p>};<\/p>\n<p>int main()<br \/>\n{<br \/>\n\/\/1.\u5185\u7f6e\u7c7b\u578b\u4e4b\u95f4\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<br \/>\nint i &#061; 1;<br \/>\ndouble j &#061; i;\/\/\u5176\u5b9e\u4e2d\u95f4\u6709\u4e2a\u4e34\u65f6\u5bf9\u8c61<\/p>\n<p>const double&amp; ref1 &#061; i;\/\/\u8fd9\u4e2a\u6211\u4eec\u4e4b\u524d\u4e5f\u8bb2\u8fc7&#xff0c;\u4e2d\u95f4\u7684\u4e34\u65f6\u5bf9\u8c61\u5177\u6709\u5e38\u6027<\/p>\n<p>\/\/2.\u5185\u7f6e\u7c7b\u578b\u548c\u7c7b\u7c7b\u578b\u4e4b\u95f4\u7684\u9690\u5f0f\u8f6c\u6362<br \/>\n\/\/\u9700\u8981\u6709\u76f8\u5173\u5185\u7f6e\u7c7b\u578b\u4e3a\u53c2\u6570\u7684\u6784\u9020\u51fd\u6570<\/p>\n<p>\/\/\u8fd9\u6837\u5199\u662f\u76f4\u63a5\u6784\u9020<br \/>\nA a1(1);<br \/>\n\/\/\u8fd9\u6837\u5199\u662f\u62f7\u8d1d\u6784\u9020<br \/>\nA a2 &#061; a1;<br \/>\n\/\/\u8fd9\u4e2a\u624d\u6d89\u53ca\u5230\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<br \/>\nA a2 &#061; 1;\/\/\u5148\u6784\u9020\u4e34\u65f6\u5bf9\u8c61&#xff0c;\u518d\u5c06\u4e34\u65f6\u5bf9\u8c61\u62f7\u8d1d\u7ed9a2<\/p>\n<p>const A&amp; ref2 &#061; a1;<br \/>\nconst A&amp; ref3 &#061; 1;\/\/\u540c\u7406<\/p>\n<p>\/\/\u4e09\u79cd\u90fd\u53ef\u4ee5&#xff0c;\u56e0\u4e3a\u4e0a\u9762\u7684\u51fd\u6570\u53c2\u6570\u662f\u7528\u8fc7const\u4fee\u9970\u7684(\u6240\u4ee5\u7b2c\u4e8c\u79cd\u4e5fok)<br \/>\nfunc(a1);<br \/>\nfunc(1);<br \/>\nfunc();<\/p>\n<p>\/\/\u6211\u4eec\u518d\u6765\u770b\u770b\u522b\u7684\u4f7f\u7528\u573a\u666f<br \/>\nStack s1;<br \/>\n\/\/\u8fd9\u6837\u5199\u6709\u70b9\u9ebb\u70e6\u4e86<br \/>\nA a3(3);<br \/>\ns1.Push(a3);<\/p>\n<p>\/\/\u5c31\u53ef\u4ee5\u76f4\u63a5\u8fd9\u6837\u5199<br \/>\ns1.Push(3);<\/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\/01\/20260128091802-6979d44ae51ba.png\" \/><\/p>\n<p>\u591a\u53c2\u6570\u8f6c\u5316\u4ee5\u53ca\u7c7b\u548c\u7c7b\u4e4b\u95f4\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362&#xff1a;<\/p>\n<p>\/\/\u518d\u6765\u770b\u770b\u591a\u53c2\u6570\u8f6c\u5316\u4ee5\u53ca\u7c7b\u548c\u7c7b\u4e4b\u95f4\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class A<br \/>\n{<br \/>\npublic:<br \/>\n\/\/ \u6784\u9020\u51fd\u6570explicit\u5c31\u4e0d\u518d\u652f\u6301\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<br \/>\n\/\/ explicit A(int a1)<br \/>\nA(int a1)<br \/>\n:_a1(a1)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;A(int a1)&#034; &lt;&lt; &#039;\\\\n&#039;;<br \/>\n}<\/p>\n<p>A(const A&amp; aa)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;A(const A&amp; aa)&#034; &lt;&lt; &#039;\\\\n&#039;;<br \/>\n}<\/p>\n<p>A(int a1, int a2)<br \/>\n:_a1(a1)<br \/>\n, _a2(a2)<br \/>\n{<br \/>\n}<\/p>\n<p>int Get() const<br \/>\n{<br \/>\nreturn _a1 &#043; _a2;<br \/>\n}<\/p>\n<p>private:<br \/>\nint _a1 &#061; 1;<br \/>\nint _a2 &#061; 2;<br \/>\n};<\/p>\n<p>class B<br \/>\n{<br \/>\npublic:<br \/>\n\/\/\u7c7b\u548c\u7c7b\u4e4b\u95f4\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362&#xff0c;\u5c31\u9700\u8981\u53c2\u6570\u662f\u7c7b\u7c7b\u578b\u76f8\u5173\u4e86<br \/>\nB(const A&amp; a)<br \/>\n:_b(a.Get())<br \/>\n{<br \/>\n}<br \/>\nprivate:<br \/>\nint _b &#061; 0;<br \/>\n};<\/p>\n<p>int main()<br \/>\n{<br \/>\n\/\/\u518d\u6765\u8ddf\u5927\u5bb6\u5c55\u793a\u4e00\u4e2a\u4f18\u5316&#xff0c;\u4e0a\u9762\u6ca1\u63d0\u5230<br \/>\n\/\/ \u6784\u9020<br \/>\nA a1(1);<\/p>\n<p>\/\/ \u8fd9\u91cc\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u5176\u5b9e\u5c31\u662f&#xff0c;2\u4e3a\u53c2\u6570\u6784\u9020\u4e34\u65f6\u5bf9\u8c61&#xff0c;\u4e34\u65f6\u5bf9\u8c61\u62f7\u8d1d\u6784\u9020a2 -&gt; \u4f18\u5316\u4e3a\u76f4\u63a5\u6784\u9020<br \/>\nA a2 &#061; 2;<br \/>\n\/\/\u8fd9\u91cc\u4e5f\u662f\u4e00\u6837<br \/>\nconst A&amp; ref1 &#061; 3;<\/p>\n<p>\/\/C&#043;&#043;11\u4e4b\u540e\u624d\u652f\u6301\u591a\u53c2\u6570\u6784\u9020<br \/>\nA a3(1, 1);\/\/\u4e3a\u76f4\u63a5\u6784\u9020<br \/>\nA a4 &#061; { 1, 1 };\/\/\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<br \/>\nconst A&amp; ref2 &#061; { 1, 1 };\/\/\u540c\u6837\u90fd\u662f\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362<\/p>\n<p>\/\/Stack st1;<br \/>\n\/\/st1.Push(a4);<br \/>\n\/\/st1.Push({2,2});\/\/\u540c\u4e0a<\/p>\n<p>\/\/\u7c7b\u548c\u7c7b\u4e4b\u95f4\u7684\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362&#xff0c;\u8ddf\u4e0a\u9762\u539f\u7406\u7c7b\u4f3c<br \/>\n\/\/\u5c06a3\u9690\u5f0f\u8f6c\u6362\u4e3ab1<br \/>\nconst B&amp; ref4 &#061; a3;<\/p>\n<p>\/\/\u539f\u7406\u5c31\u662f\u4e0b\u9762\u7684\u4ee3\u7801<br \/>\nB b1 &#061; a3;<br \/>\nconst B&amp; ref3 &#061; b1;<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p>\u6211\u4eec\u73b0\u5728\u6240\u7528\u7684\u7f16\u8bd1\u5668\u57fa\u672c\u4e0a\u90fd\u5c06\u8fd9\u4e9b\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362\u7ed9\u4f18\u5316\u4e86&#xff0c;\u5c31\u4f18\u5316\u6389\u4ea7\u751f\u4e34\u65f6\u5bf9\u8c61\u8fd9\u4e00\u90e8\u5206\u4e86&#xff0c;\u76f4\u63a5\u6784\u9020&#xff0c;\u8fd9\u6837\u51cf\u5c11\u4e86\u62f7\u8d1d&#xff0c;\u63d0\u9ad8\u4e86\u6548\u7387\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"489\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091803-6979d44b9997d.png\" width=\"1020\" \/><\/p>\n<hr \/>\n<h2 id=\"%E4%B8%89%E3%80%81static%E6%88%90%E5%91%98\" style=\"background-color:transparent\">\u4e09\u3001static\u6210\u5458<\/h2>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u7528static\u4fee\u9970\u7684\u6210\u5458\u53d8\u91cf&#xff0c;\u79f0\u4e4b\u4e3a\u9759\u6001\u6210\u5458\u53d8\u91cf&#xff0c;\u9759\u6001\u6210\u5458\u53d8\u91cf\u4e00\u5b9a\u8981\u5728\u7c7b\u5916\u8fdb\u884c\u521d\u59cb\u5316\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u9759\u6001\u6210\u5458\u53d8\u91cf\u4e3a\u6240\u6709\u7c7b\u5bf9\u8c61\u6240\u5171\u4eab&#xff0c;\u4e0d\u5c5e\u4e8e\u67d0\u4e2a\u5177\u4f53\u7684\u5bf9\u8c61&#xff0c;\u4e0d\u5b58\u5728\u5bf9\u8c61\u4e2d&#xff0c;\u5b58\u653e\u5728\u9759\u6001\u533a\u3002<\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u7528static\u4fee\u9970\u7684\u6210\u5458\u51fd\u6570&#xff0c;\u79f0\u4e4b\u4e3a\u9759\u6001\u6210\u5458\u51fd\u6570&#xff0c;\u9759\u6001\u6210\u5458\u51fd\u6570\u6ca1\u6709this\u6307\u9488\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u9759\u6001\u6210\u5458\u51fd\u6570\u4e2d\u53ef\u4ee5\u8bbf\u95ee\u5176\u4ed6\u7684\u9759\u6001\u6210\u5458&#xff0c;\u4f46\u662f\u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001\u7684&#xff0c;\u56e0\u4e3a\u6ca1\u6709this\u6307\u9488\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u975e\u9759\u6001\u7684\u6210\u5458\u51fd\u6570&#xff0c;\u53ef\u4ee5\u8bbf\u95ee\u4efb\u610f\u7684\u9759\u6001\u6210\u5458\u53d8\u91cf\u548c\u9759\u6001\u6210\u5458\u51fd\u6570\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u7a81\u7834\u7c7b\u57df\u5c31\u53ef\u4ee5\u8bbf\u95ee\u9759\u6001\u6210\u5458&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u7c7b\u540d::\u9759\u6001\u6210\u5458 \u6216\u8005 \u5bf9\u8c61.\u9759\u6001\u6210\u5458 \u6765\u8bbf\u95ee\u9759\u6001\u6210\u5458\u53d8\u91cf\u548c\u9759\u6001\u6210\u5458\u51fd\u6570\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u9759\u6001\u6210\u5458\u4e5f\u662f\u7c7b\u7684\u6210\u5458&#xff0c;\u53d7public\u3001protected\u3001private \u8bbf\u95ee\u9650\u5b9a\u7b26\u7684\u9650\u5236\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u9759\u6001\u6210\u5458\u53d8\u91cf\u4e0d\u80fd\u5728\u58f0\u660e\u4f4d\u7f6e\u7ed9\u7f3a\u7701\u503c\u521d\u59cb\u5316&#xff0c;\u56e0\u4e3a\u7f3a\u7701\u503c\u662f\u4e2a\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u5217\u8868\u7684&#xff0c;\u9759\u6001\u6210\u5458\u53d8\u91cf\u4e0d\u5c5e\u4e8e\u67d0\u4e2a\u5bf9\u8c61&#xff0c;\u4e0d\u8d70\u6784\u9020\u51fd\u6570\u521d\u59cb\u5316\u5217\u8868\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u7528\u4ee3\u7801\u6765\u8fdb\u4e00\u6b65\u8bf4\u660e\u6bcf\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class A<br \/>\n{<br \/>\npublic:<br \/>\n\/\/\u975e\u9759\u6001\u7684\u6210\u5458\u51fd\u6570&#xff0c;\u53ef\u4ee5\u8bbf\u95ee\u4efb\u610f\u9759\u6001\u6210\u5458\u53d8\u91cf\u4ee5\u53ca\u975e\u9759\u6001\u7684\u6210\u5458\u53d8\u91cf<br \/>\nA(int a &#061; 0)<br \/>\n:_a1(a)<br \/>\n, _a2(a)<br \/>\n{<br \/>\n&#043;&#043;_count;<br \/>\n}<\/p>\n<p>A(const A&amp; t)<br \/>\n{<br \/>\n&#043;&#043;_count;<br \/>\n}<\/p>\n<p>\/\/\u2fae\u9759\u6001\u7684\u6210\u5458\u51fd\u6570&#xff0c;\u53ef\u4ee5\u8bbf\u95ee\u4efb\u610f\u7684\u9759\u6001\u6210\u5458\u53d8\u91cf\u548c\u9759\u6001\u6210\u5458\u51fd\u6570<br \/>\n\/\/\u9759\u6001\u6210\u5458\u51fd\u6570\u4e2d\u53ef\u4ee5\u8bbf\u95ee\u5176\u4ed6\u7684\u9759\u6001\u6210\u5458&#xff0c;\u4f46\u662f\u4e0d\u80fd\u8bbf\u95ee\u2fae\u9759\u6001\u7684&#xff0c;\u56e0\u4e3a\u6ca1\u6709this\u6307\u9488<br \/>\nstatic int GetCount()<br \/>\n{<br \/>\n\/\/ _a1&#043;&#043;; \u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001\u6210\u5458&#xff0c;\u56e0\u4e3astatic\u6210\u5458\u51fd\u6570\u6ca1\u6709this<br \/>\nreturn _count;<br \/>\n}<br \/>\nprivate:<br \/>\nint _a1 &#061; 1;<br \/>\nint _a2 &#061; 1;<br \/>\n\/\/public:<br \/>\n\/\/ \u5728\u7c7b\u91cc\u9762\u58f0\u660e&#xff0c;\u4e14\u8fd9\u91cc\u4e0d\u53ef\u4ee5\u7528\u7f3a\u7701\u503c<br \/>\nstatic int _count;<br \/>\n\/\/\u53ef\u4ee5\u8fd0\u7528\u9759\u6001\u6210\u5458\u6765\u89e3\u51b3\u7edf\u8ba1A\u7c7b\u578b\u7684\u5bf9\u8c61\u521b\u5efa\u4e86\u591a\u5c11\u4e2a\u8fd9\u6837\u7684\u95ee\u9898<br \/>\n};<\/p>\n<p>int A::_count &#061; 0;<\/p>\n<p>int main()<br \/>\n{<br \/>\n\/\/\u9759\u6001\u6210\u5458\u4e0d\u5b58\u5728\u5bf9\u8c61\u4e4b\u4e2d<br \/>\nA aa1;<br \/>\ncout &lt;&lt; sizeof(aa1) &lt;&lt; endl;\/\/8,\u8bf4\u660e_count\u4e0d\u5b58\u5728\u5bf9\u8c61\u4e2d<\/p>\n<p>A* ptr &#061; nullptr;<br \/>\nA aa2 &#061; 1;<br \/>\n\/\/\/\/\u7a81\u7834\u7c7b\u57df\u5c31\u53ef\u4ee5\u8bbf\u95ee&#xff0c;\u4f46\u662f\u53d7\u8bbf\u95ee\u9650\u5b9a\u7b26\u7684\u7ea6\u675f<br \/>\n\/\/cout &lt;&lt; ptr-&gt;_count&lt;&lt; endl;<br \/>\n\/\/cout &lt;&lt; aa1._count &lt;&lt; endl;<br \/>\n\/\/cout &lt;&lt; A::_count &lt;&lt; endl;<\/p>\n<p>\/\/\u53d8\u6210\u79c1\u6709\u7684\u8bdd&#xff0c;\u9700\u8981\u4f7f\u7528\u4e00\u4e0b\u51fd\u6570\u6765\u83b7\u53d6\u4e86<br \/>\ncout &lt;&lt; A::GetCount() &lt;&lt; endl;\/\/\u7a81\u7834\u7c7b\u57df\u53ef\u4ee5\u8bbf\u95ee\u516c\u6709\u7684\u9759\u6001\u6210\u5458<br \/>\ncout &lt;&lt; aa2.GetCount() &lt;&lt; endl;<br \/>\ncout &lt;&lt; ptr-&gt;GetCount() &lt;&lt; endl;<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<h3 id=\"1.%E7%BB%83%E4%B9%A0%E9%A2%981%EF%BC%9A\">1.\u7ec3\u4e60\u98981&#xff1a;<\/h3>\n<p>\u6c421&#043;2&#043;3&#043;&#8230;&#043;n_\u725b\u5ba2\u9898\u9738_\u725b\u5ba2\u7f51<\/p>\n<p>class Sum<br \/>\n{<br \/>\npublic:<br \/>\n    Sum()<br \/>\n    {<br \/>\n        _count&#043;&#061;_i;<br \/>\n        &#043;&#043;_i;<br \/>\n    }<br \/>\n    static int RetCount()<br \/>\n    {<br \/>\n        return _count;<br \/>\n    }<br \/>\nprivate:<br \/>\n    static int _i;<br \/>\n    static int _count;<br \/>\n};<\/p>\n<p>int Sum::_i&#061;1;<br \/>\nint Sum::_count&#061;0;<\/p>\n<p>class Solution {<br \/>\npublic:<br \/>\n    int Sum_Solution(int n) {<br \/>\n        Sum arr[n];\/\/\u8c03\u7528n\u6b21Sum\u7684\u6784\u9020\u51fd\u6570<br \/>\n        return Sum::RetCount();<br \/>\n    }<br \/>\n}; <\/p>\n<h3 id=\"2.%E7%BB%83%E4%B9%A0%E9%A2%982%EF%BC%9A\">2.\u7ec3\u4e60\u98982&#xff1a;<\/h3>\n<p>\u518d\u6765\u770b\u4e2a\u7ec3\u4e60<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<br \/>\nclass A<br \/>\n{<br \/>\npublic:<br \/>\n    A()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; A()&#034; &lt;&lt; endl;<br \/>\n    }<\/p>\n<p>    ~A()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; ~A()&#034; &lt;&lt; endl;<br \/>\n    }<br \/>\n};<\/p>\n<p>class B<br \/>\n{<br \/>\npublic:<br \/>\n    B()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; B()&#034; &lt;&lt; endl;<br \/>\n    }<\/p>\n<p>    ~B()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; ~B()&#034; &lt;&lt; endl;<br \/>\n    }<br \/>\n};<\/p>\n<p>class C<br \/>\n{<br \/>\npublic:<br \/>\n    C()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; C()&#034; &lt;&lt; endl;<br \/>\n    }<\/p>\n<p>    ~C()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; ~C()&#034; &lt;&lt; endl;<br \/>\n    }<br \/>\n};<\/p>\n<p>class D<br \/>\n{<br \/>\npublic:<br \/>\n    D()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; D()&#034; &lt;&lt; endl;<br \/>\n    }<\/p>\n<p>    ~D()<br \/>\n    {<br \/>\n        cout &lt;&lt; &#034; ~D()&#034; &lt;&lt; endl;<br \/>\n    }<br \/>\n};<\/p>\n<p>\/\/\u6784\u9020\u987a\u5e8f<br \/>\n\/\/\u6790\u6784\u987a\u5e8f<br \/>\nC c;<br \/>\nint main()<br \/>\n{<br \/>\n    A a;<br \/>\n    B b;<br \/>\n    static D d;<\/p>\n<p>    return 0;<br \/>\n} <\/p>\n<p>\u8fd9\u4e2a\u9898\u8981\u6211\u4eec\u6c42\u8fd9\u4e2a\u7a0b\u5e8f\u7684ABCD\u56db\u4e2a\u5bf9\u8c61\u7684\u6784\u9020\u987a\u5e8f\u548c\u6790\u6784\u987a\u5e8f&#xff0c;\u5927\u5bb6\u53ef\u4ee5\u81ea\u5df1\u8fd0\u884c\u4e00\u4e0b\u7b54\u6848\u5c31\u51fa\u6765\u4e86\u3002&#xff08;\u6ce8\u610f&#xff1a;\u9759\u6001\u6210\u5458\u4e0d\u5b58\u50a8\u5728\u5bf9\u8c61\u4e2d&#xff0c;\u800c\u662f\u5b58\u50a8\u5728\u9759\u6001\u533a&#xff09;<\/p>\n<hr \/>\n<h2 id=\"%E5%9B%9B%E3%80%81%E5%8F%8B%E5%85%83\">\u56db\u3001\u53cb\u5143<\/h2>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u53cb\u5143\u63d0\u4f9b\u4e86\u4e00\u79cd\u7a81\u7834\u7c7b\u8bbf\u95ee\u9650\u5b9a\u7b26\u5c01\u88c5\u7684\u65b9\u5f0f&#xff0c;\u53cb\u5143\u5206\u4e3a&#xff1a;\u53cb\u5143\u51fd\u6570\u548c\u53cb\u5143\u7c7b&#xff0c;\u5728\u51fd\u6570\u58f0\u660e\u6216\u8005\u7c7b\u58f0\u660e\u7684\u524d\u9762\u52a0friend&#xff0c;\u5e76\u4e14\u628a\u53cb\u5143\u58f0\u660e\u653e\u5230\u4e00\u4e2a\u7c7b\u7684\u91cc\u9762\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5916\u90e8\u53cb\u5143\u51fd\u6570\u53ef\u8bbf\u95ee\u7c7b\u7684\u79c1\u6709\u548c\u4fdd\u62a4\u6210\u5458&#xff0c;\u53cb\u5143\u51fd\u6570\u4ec5\u4ec5\u662f\u4e00\u79cd\u58f0\u660e&#xff0c;\u4ed6\u4e0d\u662f\u7c7b\u7684\u6210\u5458\u51fd\u6570\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u53cb\u5143\u51fd\u6570\u53ef\u4ee5\u5728\u7c7b\u5b9a\u4e49\u7684\u4efb\u4f55\u5730\u65b9\u58f0\u660e&#xff0c;\u4e0d\u53d7\u7c7b\u8bbf\u95ee\u9650\u5b9a\u7b26\u9650\u5236\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u4e00\u4e2a\u51fd\u6570\u53ef\u4ee5\u662f\u591a\u4e2a\u7c7b\u7684\u53cb\u5143\u51fd\u6570\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u53cb\u5143\u7c7b\u4e2d\u7684\u6210\u5458\u51fd\u6570\u90fd\u53ef\u4ee5\u662f\u53e6\u4e00\u4e2a\u7c7b\u7684\u53cb\u5143\u51fd\u6570&#xff0c;\u90fd\u53ef\u4ee5\u8bbf\u95ee\u53e6\u4e00\u4e2a\u7c7b\u4e2d\u7684\u79c1\u6709\u548c\u4fdd\u62a4\u6210\u5458\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u53cb\u5143\u7c7b\u7684\u5173\u7cfb\u662f\u5355\u5411\u7684&#xff0c;\u4e0d\u5177\u6709\u4ea4\u6362\u6027&#xff0c;\u6bd4\u5982A\u7c7b\u662fB\u7c7b\u7684\u53cb\u5143&#xff0c;\u4f46\u662fB\u7c7b\u4e0d\u662fA\u7c7b\u7684\u53cb\u5143\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u53cb\u5143\u7c7b\u5173\u7cfb\u4e0d\u80fd\u4f20\u9012&#xff0c;\u5982\u679cA\u662fB\u7684\u53cb\u5143&#xff0c; B\u662fC\u7684\u53cb\u5143&#xff0c;\u4f46\u662fA\u4e0d\u662fC\u7684\u53cb\u5143\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u6709\u65f6\u63d0\u4f9b\u4e86\u4fbf\u5229\u3002\u4f46\u662f\u53cb\u5143\u4f1a\u589e\u52a0\u8026\u5408\u5ea6&#xff0c;\u7834\u574f\u4e86\u5c01\u88c5&#xff0c;\u6240\u4ee5\u53cb\u5143\u4e0d\u5b9c\u591a\u7528\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u6765\u7528\u4ee3\u7801\u8bf4\u660e\u6bcf\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<h3 id=\"1.%E5%8F%8B%E5%85%83%E5%87%BD%E6%95%B0%EF%BC%9A\">1.\u53cb\u5143\u51fd\u6570&#xff1a;<\/h3>\n<p>\/\/\u53cb\u5143\u51fd\u6570<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>\/\/\u524d\u7f6e\u58f0\u660eB\u7c7b&#xff0c;\u5426\u5219A\u7684\u53cb\u5143\u51fd\u6570\u58f0\u660e\u90a3\u91cc\u7f16\u8bd1\u5668\u4e0d\u8ba4\u8bc6B<br \/>\n\/\/\u56e0\u4e3a\u53ea\u4f1a\u5411\u4e0a\u627e<br \/>\nclass B;<\/p>\n<p>class A<br \/>\n{<br \/>\n\/\/ \u53cb\u5143\u58f0\u660e<br \/>\nfriend void func(const A&amp; aa, const B&amp; bb);<br \/>\nprivate:<br \/>\nint _a1 &#061; 1;<br \/>\nint _a2 &#061; 2;<br \/>\n};<\/p>\n<p>class B<br \/>\n{<br \/>\n\/\/ \u53cb\u5143\u58f0\u660e<br \/>\nfriend void func(const A&amp; aa, const B&amp; bb);<br \/>\nprivate:<br \/>\nint _b1 &#061; 3;<br \/>\nint _b2 &#061; 4;<br \/>\n};<\/p>\n<p>void func(const A&amp; aa, const B&amp; bb)<br \/>\n{<br \/>\ncout &lt;&lt; aa._a1 &lt;&lt; endl;<br \/>\ncout &lt;&lt; bb._b1 &lt;&lt; endl;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\nA aa1;<br \/>\nB bb1;<br \/>\nfunc(aa1, bb1);<br \/>\nreturn 0;<br \/>\n} <\/p>\n<h3 id=\"2.%E5%8F%8B%E5%85%83%E7%B1%BB%EF%BC%9A\">2.\u53cb\u5143\u7c7b&#xff1a;<\/h3>\n<p>\/\/\u53cb\u5143\u7c7b&#xff0c;\u58f0\u660e\u548c\u5b9a\u4e49\u9700\u8981\u5206\u79bb&#xff0c;\u4e0d\u7136\u5c31\u7b97\u524d\u7f6e\u58f0\u660e\u4e5f\u89e3\u51b3\u4e0d\u4e86\u95ee\u9898&#xff0c;\u56e0\u4e3a\u627e\u4e0d\u5230\u7c7b\u91cc\u9762\u7684\u6210\u5458<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>\/\/xxx.h<br \/>\n\/\/\u524d\u7f6e\u58f0\u660e<br \/>\nclass D;<br \/>\nclass C<br \/>\n{<br \/>\n\/\/ \u53cb\u5143\u58f0\u660e<br \/>\nfriend class D;<br \/>\npublic:<br \/>\nvoid func1(const D&amp; dd);<br \/>\nprivate:<br \/>\nint _a1 &#061; 1;<br \/>\nint _a2 &#061; 2;<br \/>\n};<\/p>\n<p>class D<br \/>\n{<br \/>\nfriend class C;<br \/>\npublic:<br \/>\nvoid func1(const C&amp; aa);<br \/>\nvoid func2(const C&amp; aa);<br \/>\nprivate:<br \/>\nint _b1 &#061; 3;<br \/>\nint _b2 &#061; 4;<br \/>\n};<\/p>\n<p>\/\/xxx.cpp<br \/>\nvoid C::func1(const D&amp; dd)<br \/>\n{<br \/>\ncout &lt;&lt; dd._b1 &lt;&lt; endl;<br \/>\n}<br \/>\nvoid D::func1(const C&amp; aa)<br \/>\n{<br \/>\ncout &lt;&lt; aa._a1 &lt;&lt; endl;<br \/>\ncout &lt;&lt; _b1 &lt;&lt; endl;<br \/>\n}<\/p>\n<p>void D::func2(const C&amp; aa)<br \/>\n{<br \/>\ncout &lt;&lt; aa._a2 &lt;&lt; endl;<br \/>\ncout &lt;&lt; _b2 &lt;&lt; endl;<br \/>\n}<\/p>\n<p>\/\/test.cpp<br \/>\nint main()<br \/>\n{<br \/>\nC cc;<br \/>\nD dd;<br \/>\ncc.func1(dd);<br \/>\ndd.func1(cc);<br \/>\ndd.func2(cc);<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<hr \/>\n<h2 id=\"%E4%BA%94%E3%80%81%E5%86%85%E9%83%A8%E7%B1%BB\">\u4e94\u3001\u5185\u90e8\u7c7b<\/h2>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5982\u679c\u4e00\u4e2a\u7c7b\u5b9a\u4e49\u5728\u53e6\u4e00\u4e2a\u7c7b\u7684\u5185\u90e8&#xff0c;\u8fd9\u4e2a\u5185\u90e8\u7c7b\u5c31\u53eb\u505a\u5185\u90e8\u7c7b\u3002\u5185\u90e8\u7c7b\u662f\u4e00\u4e2a\u72ec\u7acb\u7684\u7c7b&#xff0c;\u8ddf\u5b9a\u4e49\u5728\u5168\u5c40\u76f8\u6bd4&#xff0c;\u4ed6\u53ea\u662f\u53d7\u5916\u90e8\u7c7b\u7c7b\u57df\u9650\u5236\u548c\u8bbf\u95ee\u9650\u5b9a\u7b26\u9650\u5236&#xff0c;\u6240\u4ee5\u5916\u90e8\u7c7b\u5b9a\u4e49\u7684\u5bf9\u8c61\u4e2d\u4e0d\u5305\u542b\u5185\u90e8\u7c7b\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5185\u90e8\u7c7b\u9ed8\u8ba4\u662f\u5916\u90e8\u7c7b\u7684\u53cb\u5143\u7c7b\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5185\u90e8\u7c7b\u672c\u8d28\u4e5f\u662f\u4e00\u79cd\u5c01\u88c5&#xff0c;\u5f53A\u7c7b\u8ddfB\u7c7b\u7d27\u5bc6\u5173\u8054&#xff0c;A\u7c7b\u5b9e\u73b0\u51fa\u6765\u4e3b\u8981\u5c31\u662f\u7ed9B\u7c7b\u4f7f\u7528&#xff0c;\u90a3\u4e48\u53ef\u4ee5\u8003\u8651\u628aA\u7c7b\u8bbe\u8ba1\u4e3aB\u7684\u5185\u90e8\u7c7b&#xff0c;\u5982\u679c\u653e\u5230private\/protected\u4f4d\u7f6e&#xff0c;\u90a3\u4e48A\u7c7b\u5c31\u662fB\u7c7b\u7684\u4e13\u5c5e\u5185\u90e8\u7c7b&#xff0c;\u5176\u4ed6\u5730\u65b9\u90fd\u7528\u4e0d\u4e86\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u7528\u4ee3\u7801\u8be6\u89e3\u5404\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class A<br \/>\n{<br \/>\nprivate:<br \/>\nstatic int _k;<br \/>\nint _h &#061; 1;<br \/>\npublic:<br \/>\n\/\/ \u5185\u90e8\u7c7b<br \/>\nclass B \/\/ B\u9ed8\u8ba4\u5c31\u662fA\u7684\u53cb\u5143<br \/>\n{<br \/>\npublic:<br \/>\nvoid foo(const A&amp; a)<br \/>\n{<br \/>\ncout &lt;&lt; _k &lt;&lt; endl; \/\/OK<br \/>\ncout &lt;&lt; a._h &lt;&lt; endl; \/\/OK<br \/>\n}<br \/>\nprivate:<br \/>\nint _b1;<br \/>\n};<br \/>\n};<\/p>\n<p>int A::_k &#061; 0;<\/p>\n<p>int main()<br \/>\n{<br \/>\n\/\/\u9759\u6001\u6210\u5458\u53d8\u91cf\u548c\u5185\u90e8\u7c7b\u90fd\u4e0d\u7b97<br \/>\ncout &lt;&lt; sizeof(A) &lt;&lt; endl;\/\/4,\u8bf4\u660e\u9759\u6001\u6210\u5458\u548c\u5185\u90e8\u7c7b\u4e0d\u5b58\u5728\u4e8e\u5bf9\u8c61\u4e2d<\/p>\n<p>\/\/ \u53d7\u5916\u90e8\u7c7b\u7c7b\u57df\u9650\u5236\u548c\u8bbf\u95ee\u9650\u5b9a\u7b26\u9650\u5236<br \/>\nA::B bb;<\/p>\n<p>A aa;<br \/>\nbb.foo(aa);<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p>\u6211\u4eec\u5728\u4e86\u89e3\u5b8c\u5185\u90e8\u7c7b\u4e4b\u540e\u53ef\u4ee5\u5c06\u524d\u9762\u7684\u4ece1\u52a0\u5230n\u7684\u9898\u4f18\u5316\u4e00\u4e0b&#xff1a;<\/p>\n<p>class Solution {<br \/>\n    class Sum {\/\/\u4f18\u5316\u4e3a\u5185\u90e8\u7c7b<br \/>\n      public:<br \/>\n        Sum() {<br \/>\n            _count &#043;&#061; _i;<br \/>\n            &#043;&#043;_i;<br \/>\n        }<br \/>\n        static int RetCount() {<br \/>\n            return _count;<br \/>\n        }<br \/>\n      private:<br \/>\n        static int _i;<br \/>\n        static int _count;<br \/>\n    };<br \/>\n  public:<br \/>\n    int Sum_Solution(int n) {<br \/>\n        Sum arr[n];\/\/\u8c03\u7528n\u6b21Sum\u7684\u6784\u9020\u51fd\u6570<br \/>\n        return Sum::RetCount();<br \/>\n    }<br \/>\n};<br \/>\nint Solution::Sum::_i &#061; 1;<br \/>\nint Solution::Sum::_count &#061; 0; <\/p>\n<hr \/>\n<h2 id=\"%E5%85%AD%E3%80%81%E5%8C%BF%E5%90%8D%E5%AF%B9%E8%B1%A1\">\u516d\u3001\u533f\u540d\u5bf9\u8c61<\/h2>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#fe2c24\">\u7528 \u7c7b\u578b(\u5b9e\u53c2) \u5b9a\u4e49\u51fa\u6765\u7684\u5bf9\u8c61\u53eb\u505a\u533f\u540d\u5bf9\u8c61<\/span><span style=\"color:#1f2329\">&#xff0c;\u76f8\u6bd4\u4e4b\u524d\u6211\u4eec\u5b9a\u4e49\u7684 \u7c7b\u578b \u5bf9\u8c61\u540d(\u5b9e\u53c2) \u5b9a\u4e49\u51fa\u6765\u7684\u53eb\u6709\u540d\u5bf9\u8c61\u3002<\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u533f\u540d\u5bf9\u8c61\u751f\u547d\u5468\u671f\u53ea\u5728\u5f53\u524d\u4e00\u884c&#xff0c;\u4e00\u822c\u4e34\u65f6\u5b9a\u4e49\u4e00\u4e2a\u5bf9\u8c61\u5f53\u524d\u7528\u4e00\u4e0b\u5373\u53ef&#xff0c;\u5c31\u53ef\u4ee5\u5b9a\u4e49\u533f\u540d\u5bf9\u8c61\u3002<\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">const \u5f15\u7528\u4f1a\u5ef6\u957f\u533f\u540d\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f&#xff0c;\u4f7f\u5176\u751f\u547d\u5468\u671f\u8ddfconst \u5f15\u7528\u4e00\u6837\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u7528\u4ee3\u7801\u8be6\u89e3\u5404\u4e2a\u7279\u70b9&#xff1a;<\/p>\n<p>\/\/\u533f\u540d\u5bf9\u8c61<br \/>\n\/\/\u5148\u62ff\u4e0a\u9762\u7684\u4e3a\u4f8b<br \/>\n#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class Solution<br \/>\n{<br \/>\nclass Sum<br \/>\n{<br \/>\npublic:<br \/>\nSum()<br \/>\n{<br \/>\n_ret &#043;&#061; _i;<br \/>\n_i&#043;&#043;;<br \/>\n}<br \/>\n};<br \/>\npublic:<br \/>\nint Sum_Solution(int n)<br \/>\n{<br \/>\n\/\/Sum arr[n];\/\/\u8981\u53d8\u957f\u6570\u7ec4&#xff0c;vs\u4e0d\u652f\u6301<br \/>\nreturn _ret;<br \/>\n}<br \/>\n\/\/\u52a0\u4e2aclear\u548c\u6790\u6784<br \/>\nvoid clear()<br \/>\n{<br \/>\n_i &#061; 1;<br \/>\n_ret &#061; 0;<br \/>\n}<\/p>\n<p>~Solution()<br \/>\n{<br \/>\ncout &lt;&lt; &#034;~Solution()&#034; &lt;&lt; &#039;\\\\n&#039;;<br \/>\n}<\/p>\n<p>private:<br \/>\nstatic int _ret;<br \/>\nstatic int _i;<br \/>\n};<br \/>\nint Solution::_i &#061; 1;<br \/>\nint Solution::_ret &#061; 0;<\/p>\n<p>void fun(const Solution&amp; s &#061; Solution(), int i &#061; 1)\/\/\u7f3a\u7701\u503c\u76f4\u63a5\u7ed9\u533f\u540d\u5bf9\u8c61<br \/>\n{<\/p>\n<p>}<\/p>\n<p>int main()<br \/>\n{<br \/>\nSolution s;\/\/\u6709\u540d\u5bf9\u8c61<br \/>\ncout &lt;&lt; s.Sum_Solution(10) &lt;&lt; &#039;\\\\n&#039;;<br \/>\ns.clear();<\/p>\n<p>\/\/\u533f\u540d\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f\u53ea\u5728\u5f53\u524d\u884c<br \/>\nSolution(); \/\/\u533f\u540d\u5bf9\u8c61<br \/>\n\/\/const \u5f15\u7528\u4f1a\u5ef6\u957f\u533f\u540d\u5bf9\u8c61\u7684\u751f\u547d\u5468\u671f&#xff0c;\u751f\u547d\u5468\u671f\u8ddfconst \u5f15\u7528\u4e00\u6837<br \/>\nconst Solution&amp; ref &#061; Solution();<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<hr \/>\n<h2 id=\"%E4%B8%83%E3%80%81%E5%AF%B9%E8%B1%A1%E6%8B%B7%E8%B4%9D%E6%97%B6%E7%9A%84%E7%BC%96%E8%AF%91%E5%99%A8%E4%BC%98%E5%8C%96\" style=\"background-color:transparent\">\u4e03\u3001\u5bf9\u8c61\u62f7\u8d1d\u65f6\u7684\u7f16\u8bd1\u5668\u4f18\u5316<\/h2>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u73b0\u4ee3\u7f16\u8bd1\u5668\u4f1a\u4e3a\u4e86\u5c3d\u53ef\u80fd\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6548\u7387&#xff0c;\u5728\u4e0d\u5f71\u54cd\u6b63\u786e\u6027\u7684\u60c5\u51b5\u4e0b\u4f1a\u5c3d\u53ef\u80fd\u51cf\u5c11\u4e00\u4e9b\u4f20\u53c2\u548c\u4f20\u8fd4\u56de\u503c\u7684\u8fc7\u7a0b\u4e2d\u53ef\u4ee5\u7701\u7565\u7684\u62f7\u8d1d\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">\u5982\u4f55\u4f18\u5316C&#043;&#043;\u6807\u51c6\u5e76\u6ca1\u6709\u4e25\u683c\u89c4\u5b9a&#xff0c;\u5404\u4e2a\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u60c5\u51b5\u81ea\u884c\u5904\u7406\u3002\u5f53\u524d\u4e3b\u6d41\u7684\u76f8\u5bf9\u65b0\u4e00\u70b9\u7684\u7f16\u8bd1\u5668\u5bf9\u4e8e\u8fde\u7eed\u4e00\u4e2a\u8868\u8fbe\u5f0f\u6b65\u9aa4\u4e2d\u7684\u8fde\u7eed\u62f7\u8d1d\u4f1a\u8fdb\u884c\u5408\u5e76\u4f18\u5316&#xff0c;\u6709\u4e9b\u66f4\u65b0\u66f4&#034;\u6fc0\u8fdb&#034;\u7684\u7f16\u8bd1\u5668\u8fd8\u4f1a\u8fdb\u884c\u8de8\u884c\u8de8\u8868\u8fbe\u5f0f\u7684\u5408\u5e76\u4f18\u5316\u3002 <\/span><\/p>\n<p><span style=\"color:#1456f0\">\u2022 <\/span><span style=\"color:#1f2329\">linux\u4e0b\u53ef\u4ee5\u5c06\u4e0b\u9762\u4ee3\u7801\u62f7\u8d1d\u5230test.cpp\u6587\u4ef6&#xff0c;\u7f16\u8bd1\u65f6\u7528 <\/span><span style=\"color:#fe2c24\">g&#043;&#043; test.cpp -fno-elide-constructors<\/span><span style=\"color:#1f2329\"> \u7684\u65b9\u5f0f\u5173\u95ed\u6784\u9020\u76f8\u5173\u7684\u4f18\u5316\u3002<\/span><\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u7528\u4ee3\u7801\u8be6\u89e3&#xff1a;<\/p>\n<p>#include&lt;iostream&gt;<br \/>\nusing namespace std;<\/p>\n<p>class A<br \/>\n{<br \/>\npublic:<br \/>\nA(int a &#061; 0)\/\/\u6784\u9020<br \/>\n:_a1(a)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;A(int a)&#034; &lt;&lt; endl;<br \/>\n}<\/p>\n<p>A(const A&amp; aa)\/\/\u62f7\u8d1d\u6784\u9020<br \/>\n:_a1(aa._a1)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;A(const A&amp; aa)&#034; &lt;&lt; endl;<br \/>\n}<\/p>\n<p>A&amp; operator&#061;(const A&amp; aa)<br \/>\n{<br \/>\ncout &lt;&lt; &#034;A&amp; operator&#061;(const A&amp; aa)&#034; &lt;&lt; endl;<br \/>\nif (this !&#061; &amp;aa)<br \/>\n{<br \/>\n_a1 &#061; aa._a1;<br \/>\n}<br \/>\nreturn *this;<br \/>\n}<\/p>\n<p>~A()<br \/>\n{<br \/>\ncout &lt;&lt; &#034;~A()&#034; &lt;&lt; endl;<br \/>\n}<br \/>\nprivate:<br \/>\nint _a1 &#061; 1;<br \/>\n};<\/p>\n<p>void f1(A aa)<br \/>\n{<\/p>\n<p>}<\/p>\n<p>A f2()<br \/>\n{<br \/>\nA aa;<br \/>\nreturn aa;<br \/>\n}<\/p>\n<p>int main()<br \/>\n{<br \/>\n\/\/ \u6784\u9020&#043;\u62f7\u8d1d\u6784\u9020 \u4f18\u5316-&gt; \u6784\u9020<\/p>\n<p>\/\/ \u4f20\u503c\u4f20\u53c2<br \/>\n\/\/ \u6784\u9020<br \/>\nA aa1 &#061; 1;<br \/>\ncout &lt;&lt; &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034; &lt;&lt; endl;<br \/>\n\/\/ \u62f7\u8d1d\u6784\u9020<br \/>\nf1(aa1);<br \/>\ncout &lt;&lt; &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034; &lt;&lt; endl;<\/p>\n<p>\/\/ \u9690\u5f0f\u7c7b\u578b&#xff0c;\u8fde\u7eed\u6784\u9020&#043;\u62f7\u8d1d\u6784\u9020-&gt;\u4f18\u5316\u4e3a\u76f4\u63a5\u6784\u9020<br \/>\nf1(1);<br \/>\ncout &lt;&lt; &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034; &lt;&lt; endl;<\/p>\n<p>\/\/ \u2f00\u4e2a\u8868\u8fbe\u5f0f\u4e2d&#xff0c;\u8fde\u7eed\u6784\u9020&#043;\u62f7\u8d1d\u6784\u9020-&gt;\u4f18\u5316\u4e3a\u2f00\u4e2a\u6784\u9020<br \/>\nf1(A(1));<br \/>\ncout &lt;&lt; &#034;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#061;&#034; &lt;&lt; endl;<\/p>\n<p>\/\/ \u4f20\u503c\u8fd4\u56de<br \/>\n\/\/ \u4e0d\u4f18\u5316\u7684\u60c5\u51b5\u4e0b\u4f20\u503c\u8fd4\u56de&#xff0c;\u7f16\u8bd1\u5668\u4f1a\u2f63\u6210\u2f00\u4e2a\u62f7\u8d1d\u8fd4\u56de\u5bf9\u8c61\u7684\u4e34\u65f6\u5bf9\u8c61\u4f5c\u4e3a\u51fd\u6570\u8c03\u2f64\u8868\u8fbe\u5f0f\u7684\u8fd4\u56de\u503c<br \/>\n\/\/ \u2f46\u4f18\u5316 &#xff08;vs2019 debug&#xff09;<br \/>\n\/\/ \u2f00\u4e9b\u7f16\u8bd1\u5668\u4f1a\u4f18\u5316\u5f97\u66f4\u5389\u5bb3&#xff0c;\u5c06\u6784\u9020\u7684\u5c40\u90e8\u5bf9\u8c61\u548c\u62f7\u8d1d\u6784\u9020\u7684\u4e34\u65f6\u5bf9\u8c61\u4f18\u5316\u4e3a\u76f4\u63a5\u6784\u9020&#xff08;vs2022 debug&#xff09;<br \/>\nf2();<br \/>\ncout &lt;&lt; endl;<\/p>\n<p>\/\/ \u8fd4\u56de\u65f6\u2f00\u4e2a\u8868\u8fbe\u5f0f\u4e2d&#xff0c;\u8fde\u7eed\u62f7\u8d1d\u6784\u9020&#043;\u62f7\u8d1d\u6784\u9020-&gt;\u4f18\u5316\u2f00\u4e2a\u62f7\u8d1d\u6784\u9020 &#xff08;vs2019 debug&#xff09;<br \/>\n\/\/ \u2f00\u4e9b\u7f16\u8bd1\u5668\u4f1a\u4f18\u5316\u5f97\u66f4\u5389\u5bb3&#xff0c;\u8fdb\u2f8f\u8de8\u2f8f\u5408\u5e76\u4f18\u5316&#xff0c;\u5c06\u6784\u9020\u7684\u5c40\u90e8\u5bf9\u8c61aa\u548c\u62f7\u8d1d\u7684\u4e34\u65f6\u5bf9\u8c61\u548c\u63a5\u6536\u8fd4\u56de\u503c\u5bf9\u8c61aa2\u4f18\u5316\u4e3a\u2f00\u4e2a\u76f4\u63a5\u6784\u9020\u3002&#xff08;vs2022 debug&#xff09;<br \/>\nA aa2 &#061; f2();<br \/>\ncout &lt;&lt; endl;<\/p>\n<p>\/\/ \u2f00\u4e2a\u8868\u8fbe\u5f0f\u4e2d&#xff0c;\u5f00\u59cb\u6784\u9020&#xff0c;\u4e2d\u95f4\u62f7\u8d1d\u6784\u9020&#043;\u8d4b\u503c\u91cd\u8f7d-&gt;\u2f46\u6cd5\u4f18\u5316&#xff08;vs2019 debug&#xff09;<br \/>\n\/\/ \u2014\u4e9b\u7f16\u8bd1\u5668\u4f1a\u4f18\u5316\u5f97\u66f4\u5389\u5bb3&#xff0c;\u8fdb\u2f8f\u8de8\u2f8f\u5408\u5e76\u4f18\u5316&#xff0c;\u5c06\u6784\u9020\u7684\u5c40\u90e8\u5bf9\u8c61aa\u548c\u62f7\u8d1d\u4e34\u65f6\u5bf9\u8c61\u5408\u5e76\u4e3a\u2014\u4e2a\u76f4\u63a5\u6784\u9020&#xff08;vs2022 debug&#xff09;<br \/>\naa1 &#061; f2();<br \/>\ncout &lt;&lt; endl;<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"579\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091803-6979d44bc88f5.png\" width=\"1385\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1251\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091804-6979d44c5d513.png\" width=\"1563\" \/><\/p>\n<p>\/\/ https:\/\/en.cppreference.com\/w\/cpp\/language\/copy_elision.html<br \/>\n\u63a5\u4e0a<br \/>\nA f2()<br \/>\n{<br \/>\n\/\/ NRVO<br \/>\n\/*A aa;<br \/>\ncout &lt;&lt; &amp;aa &lt;&lt; endl;<br \/>\nreturn aa;*\/<\/p>\n<p>\/\/ URVO<br \/>\nreturn A(1);<br \/>\n}<br \/>\nint main()<br \/>\n{<br \/>\nA aa1 &#061; f2();<br \/>\ncout &lt;&lt; &amp;aa1 &lt;&lt; endl;<\/p>\n<p>return 0;<br \/>\n}<\/p>\n<p>\/\/\u6216\u8005-&gt;<\/p>\n<p>A f2()<br \/>\n{<br \/>\n\/\/ NRVO<br \/>\nA aa;<br \/>\ncout &lt;&lt; &amp;aa &lt;&lt; endl;<br \/>\nreturn aa;<\/p>\n<p>\/\/ URVO<br \/>\n\/\/ return A(1);<br \/>\n}<br \/>\nint main()<br \/>\n{<br \/>\n\/\/\u4e0d\u63a8\u8350&#xff0c;\u7834\u574f\u4e86\u7f16\u8bd1\u5668\u7684\u4f18\u5316<br \/>\nA aa1;<br \/>\naa1 &#061; f2();<br \/>\ncout &lt;&lt; &amp;aa1 &lt;&lt; endl;<\/p>\n<p>\/\/ \u63a8\u8350<br \/>\nA aa2 &#061; f2();<br \/>\nreturn 0;<br \/>\n} <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"540\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091805-6979d44dbd356.png\" width=\"1095\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"627\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091806-6979d44e33971.png\" width=\"1131\" \/><\/p>\n<hr \/>\n<p>\u672c\u7bc7\u535a\u5ba2\u7684\u5b8c\u6574\u539f\u4ee3\u7801&#xff1a;<\/p>\n<p>\u5c0f\u5f20\u540c\u5b66\u7684CPP\u4ed3\u5e93\u2014\u2014gitee.com<\/p>\n<hr \/>\n<p>\u5f80\u671f\u56de\u987e&#xff1a;<\/p>\n<p>C&#043;&#043; \u7c7b\u548c\u5bf9\u8c61&#xff08;\u56db&#xff09;&#xff1a;const\u6210\u5458\u51fd\u6570\u3001\u53d6\u5730\u5740\u8fd0\u7b97\u7b26\u91cd\u8f7d\u5168\u7cbe\u8bb2-CSDN\u535a\u5ba2<\/p>\n<p>C&#043;&#043; Date\u65e5\u671f\u7c7b\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0\u5168\u89e3\u6790-CSDN\u535a\u5ba2<\/p>\n<p>C&#043;&#043; \u7c7b\u548c\u5bf9\u8c61&#xff08;\u4e09&#xff09;&#xff1a;\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u4e0e\u8d4b\u503c\u8fd0\u7b97\u7b26\u91cd\u8f7d\u4e4b\u6838\u5fc3\u5b9e\u73b0-CSDN\u535a\u5ba2<\/p>\n<p>C&#043;&#043; \u7c7b\u548c\u5bf9\u8c61&#xff08;\u4e8c&#xff09;&#xff1a;\u5b9e\u4f8b\u5316\u3001this\u6307\u9488\u3001\u6784\u9020\u51fd\u6570\u3001\u6790\u6784\u51fd\u6570\u8be6\u89e3-CSDN\u535a\u5ba2<\/p>\n<hr \/>\n<p>\u7ed3\u8bed&#xff1a;<\/p>\n<p>\u672c\u6587\u6df1\u5165\u8bb2\u89e3\u4e86C&#043;&#043;\u7c7b\u548c\u5bf9\u8c61\u7684\u6838\u5fc3\u6982\u5ff5&#xff0c;\u5305\u62ec\u521d\u59cb\u5316\u5217\u8868\u3001\u7c7b\u578b\u8f6c\u6362\u3001static\u6210\u5458\u3001\u53cb\u5143\u5173\u7cfb\u548c\u533f\u540d\u5bf9\u8c61\u7b49\u7279\u6027\u3002\u91cd\u70b9\u5206\u6790\u4e86\u521d\u59cb\u5316\u5217\u8868\u7684\u4f7f\u7528\u89c4\u5219&#xff08;\u5fc5\u987b\u521d\u59cb\u5316\u5f15\u7528\u3001const\u6210\u5458\u7b49&#xff09;\u3001\u7c7b\u578b\u8f6c\u6362\u7684\u9690\u5f0f\u89c4\u5219&#xff08;explicit\u7981\u6b62\u9690\u5f0f\u8f6c\u6362&#xff09;\u3001static\u6210\u5458\u7684\u5171\u4eab\u7279\u6027&#xff08;\u7c7b\u5916\u521d\u59cb\u5316&#xff09;\u3001\u53cb\u5143\u5173\u7cfb\u7684\u5355\u5411\u6027\u7b49\u7279\u70b9&#xff0c;\u5982\u679c\u6587\u7ae0\u5bf9\u4f60\u6709\u5e2e\u52a9\u7684\u8bdd&#xff0c;\u6b22\u8fce\u8bc4\u8bba&#xff0c;\u70b9\u8d5e&#xff0c;\u6536\u85cf\u52a0\u5173\u6ce8&#xff0c;\u611f\u8c22\u5927\u5bb6\u7684\u652f\u6301\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#x1f525;\u4e2a\u4eba\u4e3b\u9875&#xff1a;\u5c0f\u5f20\u540c\u5b66 &#x1f3ac;\u4f5c\u8005\u7b80\u4ecb&#xff1a;C\u7814\u53d1\u65b9\u5411\u5b66\u4e60\u8005 &#x1f4d6;\u4e2a\u4eba\u4e13\u680f&#xff1a;\u00a0\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u300b\u300aC\u6df1\u5ea6\u5256\u6790&#xff1a;\u4ece\u5165\u95e8\u5230\u6df1\u8015\u300b \u2b50\ufe0f\u4eba\u751f\u683c\u8a00&#xff1a;\u65e0\u89c6\u4e2d\u65ad&#xff0c;\u4e0d\u5f03\u70ed\u6795&#xff0c;\u65b9\u5f97\u575a\u6301\u4e4b\u9053\u3002 \u524d\u8a00&#xff1a;<br \/>\n\u524d\u9762\u6211\u4eec\u5b66\u4e60\u5b8c\u4e866\u79cd\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u4ee5\u53caDate\u7c7b\u7684\u5b9e\u73b0\u3002\u4eca\u5929\u8fd9\u7bc7\u535a\u5ba2\u662f\u7c7b\u548c\u5bf9\u8c61\u7684\u6700\u540e\u4e00\u4e9b\u77e5\u8bc6&#xff0c;\u4e3b\u8981\u4f1a\u6d89\u53ca\u521d\u59cb\u5316\u5217\u8868\u3001\u7c7b\u578b\u8f6c\u6362\u3001st<\/p>\n","protected":false},"author":2,"featured_media":67363,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,190,1813,427],"topic":[],"class_list":["post-67375","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-c","tag-190","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++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \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\/67375.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"&#x1f525;\u4e2a\u4eba\u4e3b\u9875&#xff1a;\u5c0f\u5f20\u540c\u5b66 &#x1f3ac;\u4f5c\u8005\u7b80\u4ecb&#xff1a;C\u7814\u53d1\u65b9\u5411\u5b66\u4e60\u8005 &#x1f4d6;\u4e2a\u4eba\u4e13\u680f&#xff1a;\u00a0\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u300b\u300aC\u6df1\u5ea6\u5256\u6790&#xff1a;\u4ece\u5165\u95e8\u5230\u6df1\u8015\u300b \u2b50\ufe0f\u4eba\u751f\u683c\u8a00&#xff1a;\u65e0\u89c6\u4e2d\u65ad&#xff0c;\u4e0d\u5f03\u70ed\u6795&#xff0c;\u65b9\u5f97\u575a\u6301\u4e4b\u9053\u3002 \u524d\u8a00&#xff1a; \u524d\u9762\u6211\u4eec\u5b66\u4e60\u5b8c\u4e866\u79cd\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u4ee5\u53caDate\u7c7b\u7684\u5b9e\u73b0\u3002\u4eca\u5929\u8fd9\u7bc7\u535a\u5ba2\u662f\u7c7b\u548c\u5bf9\u8c61\u7684\u6700\u540e\u4e00\u4e9b\u77e5\u8bc6&#xff0c;\u4e3b\u8981\u4f1a\u6d89\u53ca\u521d\u59cb\u5316\u5217\u8868\u3001\u7c7b\u578b\u8f6c\u6362\u3001st\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/67375.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-28T09:18:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091757-6979d445e6bcb.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\/67375.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/67375.html\",\"name\":\"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-28T09:18:07+00:00\",\"dateModified\":\"2026-01-28T09:18:07+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/67375.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/67375.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/67375.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565\"}]},{\"@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++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \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\/67375.html","og_locale":"zh_CN","og_type":"article","og_title":"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"&#x1f525;\u4e2a\u4eba\u4e3b\u9875&#xff1a;\u5c0f\u5f20\u540c\u5b66 &#x1f3ac;\u4f5c\u8005\u7b80\u4ecb&#xff1a;C\u7814\u53d1\u65b9\u5411\u5b66\u4e60\u8005 &#x1f4d6;\u4e2a\u4eba\u4e13\u680f&#xff1a;\u00a0\u300aC\u8bed\u8a00\u300b\u300a\u6570\u636e\u7ed3\u6784\u300b\u300aC\u6df1\u5ea6\u5256\u6790&#xff1a;\u4ece\u5165\u95e8\u5230\u6df1\u8015\u300b \u2b50\ufe0f\u4eba\u751f\u683c\u8a00&#xff1a;\u65e0\u89c6\u4e2d\u65ad&#xff0c;\u4e0d\u5f03\u70ed\u6795&#xff0c;\u65b9\u5f97\u575a\u6301\u4e4b\u9053\u3002 \u524d\u8a00&#xff1a; \u524d\u9762\u6211\u4eec\u5b66\u4e60\u5b8c\u4e866\u79cd\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u4ee5\u53caDate\u7c7b\u7684\u5b9e\u73b0\u3002\u4eca\u5929\u8fd9\u7bc7\u535a\u5ba2\u662f\u7c7b\u548c\u5bf9\u8c61\u7684\u6700\u540e\u4e00\u4e9b\u77e5\u8bc6&#xff0c;\u4e3b\u8981\u4f1a\u6d89\u53ca\u521d\u59cb\u5316\u5217\u8868\u3001\u7c7b\u578b\u8f6c\u6362\u3001st","og_url":"https:\/\/www.wsisp.com\/helps\/67375.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-28T09:18:07+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/01\/20260128091757-6979d445e6bcb.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\/67375.html","url":"https:\/\/www.wsisp.com\/helps\/67375.html","name":"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-28T09:18:07+00:00","dateModified":"2026-01-28T09:18:07+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/67375.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/67375.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/67375.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C++ \u7c7b\u548c\u5bf9\u8c61\uff08\u4e94\uff09\uff1a\u521d\u59cb\u5316\u5217\u8868\u3001static\u3001\u53cb\u5143\u3001\u5185\u90e8\u7c7b\u7b497\u5927\u77e5\u8bc6\u70b9\u5168\u653b\u7565"}]},{"@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\/67375","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=67375"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/67375\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/67363"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=67375"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=67375"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=67375"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=67375"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}