{"id":2125,"date":"2023-02-22T20:19:12","date_gmt":"2023-02-22T12:19:12","guid":{"rendered":"https:\/\/courtship.top\/?p=2125"},"modified":"2023-02-22T20:19:12","modified_gmt":"2023-02-22T12:19:12","slug":"c%e7%b1%bb%e7%9a%84%e5%a4%a7%e5%b0%8f","status":"publish","type":"post","link":"https:\/\/courtship.top\/index.php\/2023\/02\/22\/c%e7%b1%bb%e7%9a%84%e5%a4%a7%e5%b0%8f\/","title":{"rendered":"C++\u7c7b\u7684\u5927\u5c0f"},"content":{"rendered":"\n<p>C++\u4e2d\u7c7b\u6240\u5360\u7684\u5927\u5c0f\u8ba1\u7b97\u5e76\u6ca1\u6709\u60f3\u8c61\u4e2d\u90a3\u4e48\u7b80\u5355\uff0c\u56e0\u4e3a\u6d89\u53ca\u5230<strong>\u865a\u51fd\u6570\u6210\u5458\uff0c\u9759\u6001\u6210\u5458\uff0c\u865a\u7ee7\u627f\uff0c\u591a\u7ee7\u627f\u4ee5\u53ca\u7a7a\u7c7b<\/strong>\u7b49\uff0c\u4e0d\u540c\u60c5\u51b5\u6709\u5bf9\u5e94\u7684\u8ba1\u7b97\u65b9\u5f0f\uff0c\u5728\u6b64\u5bf9\u5404\u79cd\u60c5\u51b5\u8fdb\u884c\u603b\u7ed3\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u8981\u660e\u786e\u4e00\u4e2a\u6982\u5ff5\uff0c\u5e73\u65f6\u6240\u58f0\u660e\u7684\u7c7b\u53ea\u662f\u4e00\u79cd\u7c7b\u578b\u5b9a\u4e49\uff0c\u5b83\u672c\u8eab\u662f\u6ca1\u6709\u5927\u5c0f\u53ef\u8a00\u7684\u3002 \u6211\u4eec\u8fd9\u91cc\u6307\u7684\u7c7b\u7684\u5927\u5c0f\uff0c\u5176\u5b9e\u6307\u7684\u662f\u7c7b\u7684\u5bf9\u8c61\u6240\u5360\u7684\u5927\u5c0f\u3002\u56e0\u6b64\uff0c\u5982\u679c\u7528sizeof\u8fd0\u7b97\u7b26\u5bf9\u4e00\u4e2a\u7c7b\u578b\u540d\u64cd\u4f5c\uff0c\u5f97\u5230\u7684\u662f\u5177\u6709\u8be5\u7c7b\u578b\u5b9e\u4f53\u7684\u5927\u5c0f\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5173\u4e8e\u7c7b\/\u5bf9\u8c61\u5927\u5c0f\u7684\u8ba1\u7b97<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u7c7b\u5927\u5c0f\u7684\u8ba1\u7b97\u9075\u5faa\u7ed3\u6784\u4f53\u7684\u5bf9\u9f50\u539f\u5219 <\/li>\n\n\n\n<li><strong>\u7c7b\u7684\u5927\u5c0f\u4e0e\u666e\u901a\u6570\u636e\u6210\u5458\u6709\u5173\uff0c\u4e0e\u6210\u5458\u51fd\u6570\u548c\u9759\u6001\u6210\u5458\u65e0\u5173<\/strong>\u3002\u5373\u666e\u901a\u6210\u5458\u51fd\u6570\uff0c\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u9759\u6001\u6570\u636e\u6210\u5458\uff0c\u9759\u6001\u5e38\u91cf\u6570\u636e\u6210\u5458\u5747\u5bf9\u7c7b\u7684\u5927\u5c0f\u65e0\u5f71\u54cd <\/li>\n\n\n\n<li><strong>\u865a\u51fd\u6570\u5bf9\u7c7b\u7684\u5927\u5c0f\u6709\u5f71\u54cd<\/strong>\uff0c\u662f\u56e0\u4e3a\u865a\u51fd\u6570\u8868\u6307\u9488\u5e26\u6765\u7684\u5f71\u54cd <\/li>\n\n\n\n<li>\u865a\u7ee7\u627f\u5bf9\u7c7b\u7684\u5927\u5c0f\u6709\u5f71\u54cd\uff0c\u662f\u56e0\u4e3a\u865a\u57fa\u8868\u6307\u9488\u5e26\u6765\u7684\u5f71\u54cd <\/li>\n\n\n\n<li>\u7a7a\u7c7b\u7684\u5927\u5c0f\u662f\u4e00\u4e2a\u7279\u6b8a\u60c5\u51b5,\u7a7a\u7c7b\u7684\u5927\u5c0f\u4e3a1\u3002<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>\u7ed3\u6784\u4f53\u7684\u5bf9\u9f50\u539f\u5219<\/strong><\/h2>\n\n\n\n<p><strong>\u4e3a\u4e86\u8bbf\u95ee\u901f\u5ea6\u548c\u6548\u7387\uff0c\u9700\u8981\u5404\u79cd\u7c7b\u578b\u6570\u636e\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u5728\u7a7a\u95f4\u4e0a\u6392\u5217<\/strong>\uff1b\u4e0d\u662f\u6240\u6709\u7684\u786c\u4ef6\u5e73\u53f0\u90fd\u80fd\u8bbf\u95ee\u4efb\u610f\u5730\u5740\u4e0a\u7684\u4efb\u610f\u6570\u636e\u7684\uff1b\u67d0\u4e9b\u786c\u4ef6\u5e73\u53f0\u53ea\u80fd\u5728\u67d0\u4e9b\u5730\u5740\u5904\u53d6\u67d0\u4e9b\u7279\u5b9a\u7c7b\u578b\u7684\u6570\u636e\uff0c\u5426\u5219\u629b\u51fa\u786c\u4ef6\u5f02\u5e38\u3002<\/p>\n\n\n\n<p><strong>\u4e3a\u4e86\u8bbf\u95ee\u672a\u5bf9\u2eec\u7684\u5185\u5b58\uff0c\u5904\u7406\u5668\u9700\u8981\u4f5c\u4e24\u6b21\u5185\u5b58\u8bbf\u95ee\uff1b\u2f7d\u5bf9\u2eec\u7684\u5185\u5b58\u8bbf\u95ee\u4ec5\u9700\u8981\u2f00\u6b21\u8bbf\u95ee\u3002<\/strong><br \/>\u4e8e\u662f\u6709\u4e86\u5b57\u8282\u5bf9\u9f50\uff0c4\u4e2a\u5b57\u8282\u662f\u4e00\u4e2a\u81ea\u7136\u5bf9\u9f50<br \/>\u4e3a\u4ec0\u4e48\u662f4\u4e2a\u5b57\u8282\uff1f<br \/>32\u4f4d\u673a\uff0c\u5373\u8ba1\u7b97\u673a\u6570\u636e\u603b\u7ebf\u5bbd\u5ea6\u4e3a32\u4e2a\uff0c\u4e00\u6b21\u53ef\u4ee5\u5904\u740632\u4f4dbit\uff08\u53734\u4e2a\u5b57\u8282\uff0964\u4f4d\u673a\uff0c\u5c31\u662f8\u5b57\u8282\uff1b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>struct MyStruct\n{\n\tchar a;\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\n\t\/\/\u504f\u79fb\u91cf\u4e3a0\uff0c\u6ee1\u8db3\u5bf9\u9f50\u65b9\u5f0f\uff0ca\u5360\u75281\u4e2a\u5b57\u8282\uff0c\uff08\u6700\u5927\u7c7b\u578b\u5b57\u8282\u6570\u4e3a8\uff0c\u53608\u5b57\u8282\uff09\uff1b\n\tdouble b;\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\n\t\/\/\u4e0b\u4e00\u4e2a\u53ef\u7528\u7684\u5730\u5740\u7684\u504f\u79fb\u91cf\u4e3a1\uff0c\u4e0d\u662fsizeof(double)=8\u7684\u500d\u6570\uff0c\u9700\u8981\u8865\u8db37\u4e2a\u5b57\u8282\u624d\u80fd\u4f7f\u504f\u79fb\u91cf\u53d8\u4e3a8\uff08\u6ee1\u8db3\u5bf9\u9f50\u65b9\u5f0f\uff09\uff0c\u56e0\u6b64\u81ea\u52a8\u586b\u51457\u4e2a\u5b57\u8282\uff0cb\u5b58\u653e\u5728\u504f\u79fb\u91cf\u4e3a8\u7684\u5730\u5740\u4e0a\uff0c\u5b83\u5360\u75288\u4e2a\u5b57\u8282\u3002\n\tint c;\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\n\t\/\/\u4e0b\u4e00\u4e2a\u53ef\u7528\u7684\u5730\u5740\u7684\u504f\u79fb\u91cf\u4e3a16\uff0c\u662fsizeof(int)=4\u7684\u500d\u6570\uff0c\u6ee1\u8db3int\u7684\u5bf9\u9f50\u65b9\u5f0f\uff0c\u6240\u4ee5\u4e0d\u9700\u8981VC\u81ea\u52a8\u586b\u5145\uff0cc\u5b58\u653e\u5728\u504f\u79fb\u91cf\u4e3a16\u7684\u5730\u5740\u4e0a\uff0c\u5b83\u5360\u75284\u4e2a\u5b57\u8282\u3002\n};\n\/\/\u6240\u6709\u6210\u5458\u53d8\u91cf\u90fd\u5206\u914d\u4e86\u7a7a\u95f4\uff0c\u7a7a\u95f4\u603b\u7684\u5927\u5c0f\u4e3a1+7+8+4=20\uff0c\u4e0d\u662f\u7ed3\u6784\u7684\u8282\u8fb9\u754c\u6570\uff08\u5373\u7ed3\u6784\u4e2d\u5360\u7528\u6700\u5927\u7a7a\u95f4\u7684\u7c7b\u578b\u6240\u5360\u7528\u7684\u5b57\u8282\u6570sizeof(double)=8\uff09\u7684\u500d\u6570\uff0c\n\/\/\u6240\u4ee5\u9700\u8981\u586b\u51454\u4e2a\u5b57\u8282\uff0c\u4ee5\u6ee1\u8db3\u7ed3\u6784\u7684\u5927\u5c0f\u4e3asizeof(double)=8\u7684\u500d\u6570\uff0c24\u5b57\u8282\u5927\u5c0f<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>\nclass Base\n{\npublic:\n\tBase() {};\n\t~Base() {};\n\nprivate:\n\tstatic int a;\n\tint b;\n\tchar c;\n};\n\n\/\/8\n\/\/\u56e0\u4e3astatic\u4e0d\u8ba1\u5165\u5bf9\u8c61\u5927\u5c0f \u6309\u7167\u5185\u5b58\u5bf9\u9f50\u89c4\u5219\u4e3a8<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u7a7a\u7c7b\u7684\u5927\u5c0f<\/h3>\n\n\n\n<p>C++\u7684\u7a7a\u7c7b\u662f\u6307\u8fd9\u4e2a\u7c7b\u4e0d\u5e26\u4efb\u4f55\u6570\u636e\uff0c\u5373\u7c7b\u4e2d\u6ca1\u6709\u975e\u9759\u6001(non-static)\u6570\u636e\u6210\u5458\u53d8\u91cf\uff0c\u6ca1\u6709\u865a\u51fd\u6570(virtual function)\uff0c\u4e5f\u6ca1\u6709\u865a\u57fa\u7c7b(virtual base class)\u3002<\/p>\n\n\n\n<p>\u76f4\u89c2\u5730\u770b\uff0c\u7a7a\u7c7b\u5bf9\u8c61\u4e0d\u4f7f\u7528\u4efb\u4f55\u7a7a\u95f4\uff0c\u56e0\u4e3a\u6ca1\u6709\u4efb\u4f55\u96b6\u5c5e\u5bf9\u8c61\u7684\u6570\u636e\u9700\u8981\u5b58\u50a8\u3002\u7136\u800c\uff0cC++\u6807\u51c6\u89c4\u5b9a\uff0c\u51e1\u662f\u4e00\u4e2a\u72ec\u7acb\u7684(\u975e\u9644\u5c5e)\u5bf9\u8c61\u90fd\u5fc5\u987b\u5177\u6709\u975e\u96f6\u5927\u5c0f\u3002\u6362\u53e5\u8bdd\u8bf4\uff0cC++\u7a7a\u7c7b\u7684\u5927\u5c0f\u4e0d\u4e3a0<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Base\n{\n};\n\nBase base;\ncout &lt;&lt; sizeof(base) &lt;&lt; endl; \/\/ 1<\/code><\/pre>\n\n\n\n<p>C++\u6807\u51c6\u6307\u51fa\uff0c\u4e0d\u5141\u8bb8\u4e00\u4e2a\u5bf9\u8c61\uff08\u5f53\u7136\u5305\u62ec\u7c7b\u5bf9\u8c61\uff09\u7684\u5927\u5c0f\u4e3a0\uff0c\u4e0d\u540c\u7684\u5bf9\u8c61\u4e0d\u80fd\u5177\u6709\u76f8\u540c\u7684\u5730\u5740\u3002\u8fd9\u662f\u7531\u4e8e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>new\u9700\u8981\u5206\u914d\u4e0d\u540c\u7684\u5185\u5b58\u5730\u5740\uff0c\u4e0d\u80fd\u5206\u914d\u5185\u5b58\u5927\u5c0f\u4e3a0\u7684\u7a7a\u95f4<\/li>\n\n\n\n<li>\u907f\u514d\u9664\u4ee5 sizeof(T)\u65f6\u5f97\u5230\u9664\u4ee50\u9519\u8bef<\/li>\n\n\n\n<li>\u6545\u4f7f\u7528\u4e00\u4e2a\u5b57\u8282\u6765\u533a\u5206\u7a7a\u7c7b\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4f46\u662f\uff0c\u6709\u4e24\u79cd\u60c5\u51b5\u503c\u5f97\u6211\u4eec\u6ce8\u610f<br \/>\u7b2c\u4e00\u79cd\u60c5\u51b5\uff0c\u6d89\u53ca\u5230\u7a7a\u7c7b\u7684\u7ee7\u627f\u3002<br \/>\u5f53\u6d3e\u751f\u7c7b\u7ee7\u627f\u7a7a\u7c7b\u540e\uff0c\u6d3e\u751f\u7c7b\u5982\u679c\u6709\u81ea\u5df1\u7684\u6570\u636e\u6210\u5458\uff0c\u800c\u7a7a\u57fa\u7c7b\u7684\u4e00\u4e2a\u5b57\u8282\u5e76\u4e0d\u4f1a\u52a0\u5230\u6d3e\u751f\u7c7b\u4e2d\u53bb\u3002\u4f8b\u5982<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Empty {};\nstruct D : public Empty { int a;};\n\nsizeof(D)\u4e3a4\u3002<\/code><\/pre>\n\n\n\n<p>\u7b2c\u4e8c\u79cd\u60c5\u51b5\uff0c\u4e00\u4e2a\u7c7b\u5305\u542b\u4e00\u4e2a\u7a7a\u7c7b\u5bf9\u8c61\u6570\u636e\u6210\u5458\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Empty {};\nclass HoldsAnInt {\n    int x;\n    Empty e;\n};\n\n\/\/8\n\/\/\u56e0\u4e3a\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u7a7a\u7c7b\u76841\u5b57\u8282\u662f\u4f1a\u88ab\u8ba1\u7b97\u8fdb\u53bb\u7684\u3002\u800c\u53c8\u7531\u4e8e\u5b57\u8282\u5bf9\u9f50\u7684\u539f\u5219\uff0c\u6240\u4ee5\u7ed3\u679c\u4e3a4+4=8\u3002\n\u7ee7\u627f\u7a7a\u7c7b\u7684\u6d3e\u751f\u7c7b\uff0c\u5982\u679c\u6d3e\u751f\u7c7b\u4e5f\u4e3a\u7a7a\u7c7b\uff0c\u5927\u5c0f\u4e5f\u90fd\u4e3a1<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b<\/h3>\n\n\n\n<p>\u865a\u51fd\u6570\uff08Virtual Function\uff09\u662f\u901a\u8fc7\u4e00\u5f20\u865a\u51fd\u6570\u8868\uff08Virtual Table\uff09\u6765\u5b9e\u73b0\u7684\u3002<strong>\u7f16\u8bd1\u5668\u5fc5\u9700\u8981\u4fdd\u8bc1\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\u5b58\u5728\u4e8e\u5bf9\u8c61\u5b9e\u4f8b\u4e2d\u6700\u524d\u9762\u7684\u4f4d\u7f6e\uff08\u8fd9\u662f\u4e3a\u4e86\u4fdd\u8bc1\u6b63\u786e\u53d6\u5230\u865a\u51fd\u6570\u7684\u504f\u79fb\u91cf\uff09\u3002<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>class Base {\npublic:\n\nvirtual void f() { cout &lt;&lt; \"Base::f\" &lt;&lt; endl; }\n\nvirtual void g() { cout &lt;&lt; \"Base::g\" &lt;&lt; endl; }\n\nvirtual void h() { cout &lt;&lt; \"Base::h\" &lt;&lt; endl; }\n\n};<\/code><\/pre>\n\n\n\n<p>\u5f53\u6211\u4eec\u5b9a\u4e49\u4e00\u4e2a\u8fd9\u4e2a\u7c7b\u7684\u5b9e\u4f8b\uff0cBase b\u65f6\uff0c\u5176b\u4e2d\u6210\u5458\u7684\u5b58\u653e\u5982\u4e0b\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/courtship.top\/wp-content\/uploads\/2023\/02\/\u56fe\u7247-3.png\" alt=\"\" class=\"wp-image-2130\"\/><\/figure>\n<\/div>\n\n\n<p>\u56e0\u4e3a\u5bf9\u8c61b\u4e2d\u591a\u4e86\u4e00\u4e2a\u6307\u5411\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\uff0c\u800c\u6307\u9488\u7684sizeof\u662f8\uff0c\u56e0\u6b64\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b\u6216\u5b9e\u4f8b\u6700\u540e\u7684sizeof\u662f\u5b9e\u9645\u7684\u6570\u636e\u6210\u5458\u7684sizeof\u52a08\u3002<strong>(\u5373\u5982\u679c\u7c7b\u4e2d\u5b58\u5728\u865a\u51fd\u6570\uff0c\u5219\u4f1a\u591a\u51fa\u4e00\u4e2a\u6307\u5411\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\u8ba1\u5165\uff09<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u4f8b\u5b50<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>#include&lt;iostream>\nusing namespace std;\nclass A\n{\n};\n\nclass B\n{\n    char ch;\n    virtual void func0()  {  }\n};\n\nclass C\n{\n    char ch1;\n    char ch2;\n    virtual void func()  {  }\n    virtual void func1()  {  }\n};\n\nclass D: public A, public C\n{\n    int d;\n    virtual void func()  {  }\n    virtual void func1()  {  }\n};\nclass E: public B, public C\n{\n    int e;\n    virtual void func0()  {  }\n    virtual void func1()  {  }\n};\n\nint main(void)\n{\n    cout&lt;&lt;\"A=\"&lt;&lt;sizeof(A)&lt;&lt;endl;    \/\/result=1\n    cout&lt;&lt;\"B=\"&lt;&lt;sizeof(B)&lt;&lt;endl;    \/\/result=16\n    cout&lt;&lt;\"C=\"&lt;&lt;sizeof(C)&lt;&lt;endl;    \/\/result=16\n    cout&lt;&lt;\"D=\"&lt;&lt;sizeof(D)&lt;&lt;endl;    \/\/result=24\n    cout&lt;&lt;\"E=\"&lt;&lt;sizeof(E)&lt;&lt;endl;    \/\/result=40\n    return 0;\n}  <\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>A\u4e3a\u7a7a\u7c7b\uff0c\u6240\u4ee5\u5927\u5c0f\u4e3a1<\/li>\n\n\n\n<li>B\u7684\u5927\u5c0f\u4e3achar\u6570\u636e\u6210\u5458\u5927\u5c0f+vptr\u6307\u9488\u5927\u5c0f\u3002\u7531\u4e8e\u5b57\u8282\u5bf9\u9f50,\u5927\u5c0f\u4e3a8+8=16<\/li>\n\n\n\n<li>C\u7684\u5927\u5c0f\u4e3a\u4e24\u4e2achar\u6570\u636e\u6210\u5458\u5927\u5c0f+vptr\u6307\u9488\u5927\u5c0f\u3002\u7531\u4e8e\u5b57\u8282\u5bf9\u9f50\uff0c\u5927\u5c0f\u4e3a8+8=16<\/li>\n\n\n\n<li>D\u4e3a\u591a\u7ee7\u627f\u6d3e\u751f\u7c7b\uff0c\u7531\u4e8eD\u6709\u6570\u636e\u6210\u5458\uff0c\u6240\u4ee5\u7ee7\u627f\u7a7a\u7c7bA\u65f6\uff0c\u7a7a\u7c7bA\u7684\u5927\u5c0f1\u5b57\u8282\u5e76\u6ca1\u6709\u8ba1\u5165\u5f53\u4e2d\uff0cD\u7ee7\u627fC\uff0c\u6b64\u60c5\u51b5D\u53ea\u9700\u8981\u4e00\u4e2avptr\u6307\u9488\uff0c\u6240\u4ee5\u5927\u5c0f\u4e3a\u6570\u636e\u6210\u5458\u52a0\u4e00\u4e2a\u6307\u9488\u5927\u5c0f\u3002\u7531\u4e8e\u5b57\u8282\u5bf9\u9f50,\u5927\u5c0f\u4e3a16+8=24<\/li>\n\n\n\n<li>E\u4e3a\u591a\u7ee7\u627f\u6d3e\u751f\u7c7b\uff0c\u6b64\u60c5\u51b5\u4e3a\u6211\u4eec\u4e0a\u9762\u6240\u8bb2\u7684\u591a\u91cd\u7ee7\u627f\uff0c\u542b\u865a\u51fd\u6570\u8986\u76d6\u7684\u60c5\u51b5\u3002\u6b64\u65f6\u5927\u5c0f\u8ba1\u7b97\u4e3a\u57fa\u7c7b\u5927\u5c0f\u52a0\u672c\u5730\u6570\u636e\uff0c\u8003\u8651\u5b57\u8282\u5bf9\u9f50\uff0c\u7ed3\u679c\u4e3a16+16+8=40<\/li>\n<\/ol>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>C++\u4e2d\u7c7b\u6240\u5360\u7684\u5927\u5c0f\u8ba1\u7b97\u5e76\u6ca1\u6709\u60f3\u8c61\u4e2d\u90a3\u4e48\u7b80\u5355\uff0c\u56e0\u4e3a\u6d89\u53ca\u5230\u865a\u51fd\u6570\u6210\u5458\uff0c\u9759\u6001\u6210\u5458\uff0c\u865a\u7ee7\u627f\uff0c\u591a\u7ee7\u627f\u4ee5\u53ca\u7a7a\u7c7b\u7b49\uff0c\u4e0d\u540c\u60c5\u51b5\u6709\u5bf9\u5e94\u7684\u8ba1\u7b97\u65b9\u5f0f\uff0c &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"emotion":"","emotion_color":"","title_style":"","license":"","footnotes":""},"categories":[22],"tags":[],"class_list":["post-2125","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2125","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/comments?post=2125"}],"version-history":[{"count":0,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/posts\/2125\/revisions"}],"wp:attachment":[{"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/media?parent=2125"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/categories?post=2125"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courtship.top\/index.php\/wp-json\/wp\/v2\/tags?post=2125"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}