{"id":25,"date":"2024-08-20T10:21:12","date_gmt":"2024-08-20T02:21:12","guid":{"rendered":"https:\/\/cnsn.rr.nu\/?p=25"},"modified":"2024-08-20T10:21:12","modified_gmt":"2024-08-20T02:21:12","slug":"%e3%80%90%e4%be%af%e6%8d%b7-c-%e9%9d%a2%e5%90%91%e5%af%b9%e8%b1%a1%e9%ab%98%e7%ba%a7%e5%bc%80%e5%8f%91%e3%80%91%e8%af%be%e7%a8%8b%e7%ac%94%e8%ae%b0%e4%bb%a5%e5%8f%8a%e4%b8%aa%e4%ba%ba%e6%b3%a8","status":"publish","type":"post","link":"https:\/\/blog.cnsn.fun\/?p=25","title":{"rendered":"\u3010\u4faf\u6377 C++ \u9762\u5411\u5bf9\u8c61\u9ad8\u7ea7\u5f00\u53d1\u3011\u8bfe\u7a0b\u7b14\u8bb0\u4ee5\u53ca\u4e2a\u4eba\u6ce8\u91ca"},"content":{"rendered":"<h2>\u672c\u7bc7\u5185\u5bb9<\/h2>\n<p>\u672c\u7bc7\u8bb0\u5f55\u7684\u662f\u3010\u4faf\u6377 &#8211; C++<a href=\"https:\/\/so.csdn.net\/so\/search?q=%E9%9D%A2%E5%90%91%E5%AF%B9%E8%B1%A1&amp;spm=1001.2101.3001.7020\">\u9762\u5411\u5bf9\u8c61<\/a>\u9ad8\u7ea7\u5f00\u53d1\u3011\u5165\u95e8\u8bfe\u7a0b\u3002<\/p>\n<p>\u672c\u8bfe\u7a0b\u4e00\u5171\u662f\u4e0a\u4e0b\u4e24\u90e8\u5206\uff0c\u4e0a\u90e8\u5206\u4e3b\u8981\u8bb2\u57fa\u7840\u7684OOP\u601d\u60f3\u4ee5\u53ca\u65b9\u6cd5\uff0c\u4e0b\u90e8\u5206\u662f\u6df1\u5165\u7684\u89e3\u6790\u3002\u603b\u8bfe\u65f6\u4f30\u8ba1\u662f\u5341\u6765\u5c0f\u65f6\uff0c\u653e\u5728\u56db\u4e94\u5929\u5b66\u4e60\u4f1a\u633a\u8212\u670d\u7684\u3002<\/p>\n<hr \/>\n<h3>\u4faf\u6377\u89c6\u9891\u8d44\u6e90<\/h3>\n<p>\u6e90\u81ea\u516c\u4f17\u53f7\uff1a\u7f16\u7a0b\u6307\u5317<\/p>\n<p>\u94fe\u63a5: <a href=\"https:\/\/pan.baidu.com\/s\/19REVrk-_3lpQu_fUmRBRUw\">https:\/\/pan.baidu.com\/s\/19REVrk-_3lpQu_fUmRBRUw<\/a> \u5bc6\u7801: 7iup<\/p>\n<p>\u6216\u6709\u6761\u4ef6\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8bbf\u95eeYoutube\u8d44\u6e90\u3002<\/p>\n<hr \/>\n<h2>\u7bc72 \u5934\u6587\u4ef6\u4e0e\u7c7b\u7684\u58f0\u660e<\/h2>\n<h3>\u4e3a\u4ec0\u4e48\u9762\u5411\u5bf9\u8c61<\/h3>\n<p>\u5c06\u6570\u636e\u548c\u51fd\u6570\u65b9\u6cd5\u7ed1\u5b9a\u5728\u4e00\u8d77\uff0c\u65b9\u4fbf\uff08\u65b9\u6cd5\u6574\u5408\u5230\u4e86\u4e00\u8d77\uff09\u3001\u5b89\u5168\u4e14\u9690\u79c1\uff08\u6570\u636e\u4e0d\u88ab\u89c2\u5bdf\uff09\u3002<\/p>\n<h3>Header\u9632\u536b\u5f0f\u58f0\u660e<\/h3>\n<p>\u591a\u4e2a\u6587\u4ef6\u5f15\u5165\u5934\u90e8\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u907f\u514d\u91cd\u590d\u5b9a\u4e49\u3002<\/p>\n<p>\u6525\u5199\u65b9\u6cd5\u5982\u4e0b\uff1a<\/p>\n<p><strong>complex.h<\/strong><\/p>\n<pre><code>#ifndef __COMPLEX__ \n#define __COMPLEX__\n\n#endif <\/code><\/pre>\n<h3>Header\u5e03\u5c40<\/h3>\n<p><strong>\u524d\u7f6e\u58f0\u660e\u3001\u7c7b\u58f0\u660e\u3001\u7c7b\u5b9a\u4e49\u3002<\/strong> <\/p>\n<pre><code>class ostream;\nclass complex;\n\nclass complex{};\n\ncomplex::function(){\n\n}<\/code><\/pre>\n<h3>\u7c7b\u6a21\u677f<\/h3>\n<p>\u5e0c\u671b\u7c7b\u4e2d\u67d0\u4e2a\u5c5e\u6027\u4e0d\u76f4\u63a5\u7ed1\u5b9a\u5185\u7f6e\u7c7b\u578b\uff0c\u56e0\u6b64\u76f4\u63a5\u628a\u7c7b\u578b\u62bd\u8c61\u6210\u4e00\u4e2a\u6a21\u677f\u3002<\/p>\n<pre><code>template&lt;typename T&gt;\nclass complex{\npublic:\n    complex(T a,T b):re(a),im(b){}\nprivate:\n    T re,im;\n};\n\ncomplex&lt;double&gt; c2(2.5,1.5)\ncomplex&lt;int&gt; c1(2,6)<\/code><\/pre>\n<hr \/>\n<h2>\u7bc73 \u6784\u9020\u51fd\u6570<\/h2>\n<h3>inline \u5185\u8054\u51fd\u6570<\/h3>\n<p>\u5982\u679c\u51fd\u6570\u5728<strong>class\u5185<\/strong>\u5b9a\u4e49\u5b8c\u6210\uff0c\u5219\u4f1a\u6210\u4e3ainline\u51fd\u6570\uff08\u4f46\u8981\u6c42\u51fd\u6570\u7b80\u5355\uff0c\u7f16\u8bd1\u5668\u4e0d\u62d2\u7edd\uff09\u3002<\/p>\n<p>\u4f46\u67d0\u4e9b\u590d\u6742\u51fd\u6570\u65e0\u6cd5inline\uff0c\u7f16\u8bd1\u5668\u4f1a\u62d2\u7edd\u3002<\/p>\n<h3>access level \u8bbf\u95ee\u7ea7\u522b<\/h3>\n<p>public \/ private<\/p>\n<p>\u5efa\u8bae\u6240\u6709\u7684\u6570\u636e\u90fd\u653e\u5728private\u3002<\/p>\n<h3>\u6784\u9020\u51fd\u6570<\/h3>\n<h4>\u6784\u9020\u51fd\u6570\u7684\u901a\u5e38\u5199\u6cd5<\/h4>\n<p>\u6784\u9020\u51fd\u6570\u7684\u51fd\u6570\u540d\u79f0\u4e0e\u7c7b\u4e00\u81f4\u3002\u65e0\u8fd4\u56de\u503c\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u4e0d\u5e26\u6307\u9488\u7684\u7c7b\u901a\u5e38\u4e0d\u9700\u8981\u5199\u6790\u6784\u51fd\u6570\u3002<\/p>\n<pre><code>complex(double r = 0,double i = 0):\n    re(r), im(i){   }\n\ncomplex(double r = 0,double i = 0)\n    {   re = r ; im = i; }<\/code><\/pre>\n<h4>\u652f\u6301\u91cd\u8f7d\uff0c<strong>\u4f46\u662f\u4e0d\u53ef\u4ee5\u8ba9\u7f16\u8bd1\u5668\u4ea7\u751f\u6b67\u4e49\uff0c\u5373\u5165\u4e24\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\uff08\u7b49\u4ef7\u53ef\u4ee5\uff09<\/strong><\/h4>\n<p>\u91cd\u8f7d\u4e0d\u4ec5\u6307\u5165\u53c2\u53ef\u4ee5\u4e0d\u4e00\u6837\uff0c\u51fa\u53c2\u4e5f\u53ef\u4ee5\u4e0d\u4e00\u6837\u3002<\/p>\n<p>\u7528\u4f5c\u6210\u5458set\u548c\u7528\u4f5cget\u7684\u51fd\u6570\u540d\u53ef\u4ee5\u4e00\u81f4\u3002<\/p>\n<pre><code>double real() const{return re;}\n\nvoid real(double r){re = r;}<\/code><\/pre>\n<pre><code>complex(double r = 0,double i = 0):\n    re(r), im(i){   }\n\ncomplex():\n    re(0), im(0){   }<\/code><\/pre>\n<h4>Singleton \u5355\u4f8b\u6a21\u5f0f<\/h4>\n<p>\u628a\u6784\u9020\u51fd\u6570\u653e\u5728private\uff0c\u5c31\u4e0d\u80fd\u88ab\u516c\u5171\u521b\u9020\u3002<\/p>\n<pre><code>class A{\npublic:\n    static A&amp; getInstance();\n    setup(){...}\nprivate:\n    A(); \n    A(const A&amp; rhs); \n}\n\nA&amp; A::getInstance(){\n    static A a;\n    return a;\n}<\/code><\/pre>\n<hr \/>\n<h2>\u7bc74 \u53c2\u6570\u4f20\u9012\u4e0e\u8fd4\u56de\u503c<\/h2>\n<h3>const member functions \u5e38\u91cf\u6210\u5458\u51fd\u6570<\/h3>\n<p>\u5b9a\u4e49\u51fd\u6570\u7684\u65f6\u5019\uff0c\u4e0d\u5e0c\u671b\u8be5\u51fd\u6570\u6709\u4fee\u6539\u6210\u5458\u503c\u7684\u6743\u529b\uff0c\u5c31\u52a0const\u9650\u5b9a\u8bcd\u3002<\/p>\n<pre><code>double real() const{ reutrn re; }<\/code><\/pre>\n<h3>\u53c2\u6570\u4f20\u9012\uff1apass by value vs. pass by reference(to const)<\/h3>\n<p>\u5c3d\u91cf\u4f20ref\u3002<\/p>\n<p>\u4f20value\u662f\u590d\u5236\u4e86\u4e00\u4efd\u6570\u636e\u5230\u6808\u4e0a\u3002<\/p>\n<p>\u4f20ref\u662f\u76f4\u63a5\u4f20\u5f15\u7528\uff08\u5f15\u7528\u7684\u5730\u6b65\u5c31\u662f\u6307\u9488\uff0c\u56db\u4e2a\u5b57\u8282\uff09\u3002<\/p>\n<p>\u6240\u4ee5\u4f20ref\u5feb\uff0c<strong>\u800c\u4e14\u65b9\u4fbf\u6539\u503c<\/strong>\uff08\u5c3d\u7ba1\u4f20char\u53ef\u80fd\u66f4\u5c0f\uff0c\u4e00\u4e2a\u5b57\u8282\uff0c\u4f46\u662f\u6ca1\u5fc5\u8981\u8fd9\u4e48\u7ec6\uff0c\u901a\u5e38\u6765\u8bf4\u4f20ref\u5feb\uff09\u3002\u5f53\u7136\u5982\u679c\u5e0c\u671b\u4e0d\u88ab\u6539\u503c\uff0c\u52a0const\u5173\u952e\u8bcd\u3002<\/p>\n<pre><code>complex&amp; operator += (const complex&amp;);<\/code><\/pre>\n<h3>\u8fd4\u56de\u503c\u4f20\u9012\uff1areturn by value vs. return by reference(to const)<\/h3>\n<p><strong>\u5c3d\u91cf\u8fd4ref\u3002<\/strong> <\/p>\n<h3>friend \u53cb\u5143<\/h3>\n<p>\u901a\u5e38\u5c01\u88c5\u6570\u636e\u4e4b\u540e\uff0c\u5916\u90e8\u90fd\u65e0\u6cd5\u8bbf\u95ee\u6570\u636e\u3002**\u4f46\u662f\u53cb\u5143\u53ef\u4ee5\u3002**\u4e8b\u5b9e\u4e0a\u53cb\u5143\u6709\u70b9\u8fdd\u53cd\u5c01\u88c5\u7684\u8bbe\u8ba1\u539f\u7406\u3002<\/p>\n<pre><code>class complex{\n\nprivate:\n\n    friend complex&amp; __doapl(complex*,const complex&amp; r);\n}\n\ninline complex&amp;\n    __doapl(complex* ths, const complex&amp; r){\n    ths-&gt;re += r.re; \n    this-&gt;im += r.im;\n    return *ths; \n}<\/code><\/pre>\n<h4>\u76f8\u540cclass\u7684\u5404\u4e2aobjects\u4e92\u4e3afriends<\/h4>\n<p>\u76f8\u540cclass\u7684\u5404\u4e2aobjects\u4e92\u4e3afriends\u3002\u5373\u540c\u7c7b\u7684objects\u53ef\u4ee5\u4e92\u76f8\u8bbf\u95eeprivate data\u3002<\/p>\n<hr \/>\n<h2>\u7bc75 \u64cd\u4f5c\u7b26\u91cd\u8f7d operator overloading<\/h2>\n<h3>\u6210\u5458\u51fd\u6570\u7248\u672c \u542bthis<\/h3>\n<p><strong>\u56e0\u6b64\u9700\u8981\u5728\u7c7b\u4e2d\u5199\u597d\u5b9a\u4e49\u3002<\/strong> <\/p>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<pre><code>complex c1;\ncomplex c2;\nc1 += c2;\n\ncomplex c3;\nc3 += c2 += c1;<\/code><\/pre>\n<p>\u5219\u5b9e\u73b0\u65b9\u5f0f\uff1a<\/p>\n<pre><code>inline complex&amp; complex::operator += (const complex&amp; r){\n    return __doapl(this,r);\n}<\/code><\/pre>\n<p>\u8fd9\u91cc\u9690\u85cf\u4e86\u64cd\u4f5c\u7b26\u7684\u5de6\u64cd\u4f5c\u6570\uff0c\u662fthis\uff0c\u53c2\u6570\u5217\u8868\u4e2d\u4e0d\u9700\u8981\u663e\u5f0f\u5199\u51fa\uff0c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u3002<\/p>\n<h3>\u975e\u6210\u5458\u51fd\u6570\u7248\u672c \u4e0d\u542bthis<\/h3>\n<h4>\u4e8c\u5143\u52a0\u6cd5<\/h4>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<pre><code>complex c1;\ncomplex c2;\n\nc2 = c1 + c2;\nc2 = c1 + 5;\nc2 = 7 + c1;<\/code><\/pre>\n<p>\u5219\u5b9e\u73b0\u65b9\u5f0f\uff1a<\/p>\n<p>\u8fd9\u4e2a\u7edd\u5bf9\u4e0d\u53ef\u4ee5\u8fd4\u56dereference\uff0c\u56e0\u4e3a\u76f8\u52a0\u7684object\u4e00\u5b9a\u662f\u65b0\u5efa\u4e14\u662flocal\u7684\u3002\u56e0\u6b64\u9700\u8981\u521b\u5efa\u4e34\u65f6\u5bf9\u8c61\uff08\u65e0\u540d\u79f0\uff0c\u53ea\u5728\u5f53\u524d\u884c\u6709\u7528\uff09\u8fd4\u56de\u3002<code>\u4e34\u65f6\u5bf9\u8c61\u7684\u5185\u5b58\u5730\u5740\u4e0ereturn\u51fa\u53bb\u540e\u7684\u5185\u5b58\u5730\u5740\u4e00\u81f4\u5417\uff1f<\/code><\/p>\n<h4>\u4e00\u5143\u6b63\u8d1f<\/h4>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<pre><code>complex c1;\n+c1;\n-c1; <\/code><\/pre>\n<p>\u5b9e\u73b0\u65b9\u6cd5<\/p>\n<pre><code>inline complex&amp;\noperator +(const complex&amp; x){\n    return x;\n}\n\ninline complex&amp;\noperator -(const complex&amp; x){\n    return complex(-real(x),-imag(x));\n}<\/code><\/pre>\n<h4>\u4e8c\u5143\u5224\u65ad\u662f\u5426\u76f8\u7b49\uff0c\u662f\u5426\u4e0d\u7b49<\/h4>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<pre><code>complex c1;\ncomplex c2;\n\nc1 == c2;\nc1 == 0;\n0 == c1; <\/code><\/pre>\n<h5>\u6bd4\u8f83\u76f8\u7b49<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/blog_migrate\/02f8ade0684334ee66bd0a85b69e558d.png\" alt=\"\"><\/p>\n<h5>\u6bd4\u8f83\u4e0d\u7b49<\/h5>\n<p><img decoding=\"async\" src=\"https:\/\/i-blog.csdnimg.cn\/blog_migrate\/d11c615e0ad3fff8a92c18711713243b.png\" alt=\"\"><\/p>\n<h4>&lt;&lt;\u91cd\u8f7d\uff08std\u91cd\u8f7d\uff09<\/h4>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<pre><code>complex c1(2,1);\ncout &lt;&lt; c1; \ncout &lt;&lt; c1 &lt;&lt; c1; <\/code><\/pre>\n<p>\u5b9e\u73b0\u65b9\u6848<\/p>\n<pre><code>#include &lt;iostream&gt;\n\nostream&amp;\noperator &lt;&lt; (ostream&amp; os, const compelex&amp; x){\n    return os &lt;&lt; &#039;(&#039; &lt;&lt; real(x) &lt;&lt;&#039;,&#039; &lt;&lt; imag(x) &lt;&lt; &#039;)&#039;;\n}<\/code><\/pre>\n<p><strong>\u4ee5\u4e0a\u662f\u7ecf\u5178\u6848\u4f8b1\uff0ccomplex\uff0cclass without pointer member<\/strong><\/p>\n<p><strong>\u4ee5\u4e0a\u662f\u7ecf\u5178\u6848\u4f8b2\uff0cstring\uff0cclass with pointer member<\/strong><\/p>\n<hr \/>\n<h2>\u7bc77 Big Three\uff1a\u62f7\u8d1d\u6784\u9020\u3001\u62f7\u8d1d\u8d4b\u503c\u3001\u6790\u6784<\/h2>\n<p>\u573a\u666f<\/p>\n<pre><code>String s1();\nString s2(&quot;\u6211\u662f\u4e00\u4e2a\u9152\u7cbe\u8fc7\u654f\u7684\u5e05\u54e5&quot;);\nString s3(s1); \ns3 = s2; <\/code><\/pre>\n<h3>Big Three<\/h3>\n<h4>\u7c7b\u58f0\u660e<\/h4>\n<p>**\u5982\u679c\u6210\u5458\u51fd\u6570\u542b\u6709\u6307\u9488\uff0c\u5fc5\u987b\u542b\u6709copy ctor\u548ccopy op=\u3002*<em>\u5426\u5219\u5982\u679c\u4f7f\u7528\u9ed8\u8ba4\u7684\u65b9\u6cd5\uff0c\u53ea\u662f\u6f5c\u8d4b\u503c\uff0c\u4f1a\u5171\u7528\u540c\u4e00\u4e2a\u5e95\u5c42\u7684char<\/em>\u3002<\/p>\n<pre><code>class String {\npublic:\n    String (const char* cstr = 0); \n    String (const String&amp; str); \n    String&amp; operator=(const String&amp; s); \n    ~String(); \n    char* get_c_str() const(return m_data); \nprivate:\n    char* m_data;\n}<\/code><\/pre>\n<h4>constructor\u548cdestructor\u5b9a\u4e49<\/h4>\n<pre><code>inline \nString::String(const char* cstr = 0){\n    if (cstr){\n        m_data = new char[strlen(cstr)+1];\n        strcpy(m_data,cstr);\n    }\n    else{ \n        m_data = new char[1];\n        *m_data = &#039;\\0&#039;;\n    }\n}\ninline \nString::~String(){\n    delete[] m_data;\n} <\/code><\/pre>\n<h4>copy ctor\uff08\u62f7\u8d1d\u6784\u9020\uff09<\/h4>\n<pre><code>inline \nString::String(const String&amp; str){\n    m_data = new char[str(str.m_data) + 1];\n    strcpy(m_data,str.m_data); \n }<\/code><\/pre>\n<h4>copy assignment operator(\u62f7\u8d1d\u8d4b\u503c\u51fd\u6570)<\/h4>\n<pre><code>inline\nString&amp; String::operator=(const String&amp; str){\n    if (this == &amp;str){ \n        return *this;\n    }\n    delete[] m_data; \n    m_data = new char[ strlen(str.m_data) + 1]; \n    strcpy(m_data,str.m_data); \n    return *this;\n} <\/code><\/pre>\n<h2>\u7bc78 \u6808stack\u3001\u5806heap\u4e0e\u5185\u5b58\u7ba1\u7406<\/h2>\n<h3>\u5806\u6808\u8bf4\u660e<\/h3>\n<ul>\n<li>\u6808\uff0c\u5b58\u5728\u4e8e\u67d0\u4e2a\u4f5c\u7528\u57df\u3002<\/li>\n<li>\u5806\uff0c\u5168\u5c40\u5185\u5b58\u7a7a\u95f4\uff0c\u53ef\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002<\/li>\n<\/ul>\n<pre><code>{\n    Complex c1(1,2); \n    Complex* p = new Complex(3); \n} <\/code><\/pre>\n<h3>static local objects\u7684\u751f\u547d\u5468\u671f<\/h3>\n<p>\u5176\u751f\u547d\u5728\u4f5c\u7528\u57df\u7ed3\u675f\u540e\u4ecd\u7136\u5b58\u5728<\/p>\n<pre><code>{\n    static Complex c;\n} <\/code><\/pre>\n<h3>global objects\u7684\u751f\u547d\u5468\u671f<\/h3>\n<p>\u5176\u751f\u547d\u4e00\u76f4\u5b58\u5728\uff0c\u76f4\u5230\u7a0b\u5e8f\u7ed3\u675f<\/p>\n<pre><code>Complex c3; \nint main{\n\n}<\/code><\/pre>\n<h3>heap objects\u7684\u751f\u547d\u5468\u671f<\/h3>\n<p>\u5b58\u5728\uff0c\u76f4\u5230\u88abdelete\u6389\u3002\u5982\u679c\u4e0ddelete\u5219\u5185\u5b58\u6cc4\u6f0f\uff08\u5373\u6ca1\u6709\u56de\u6536\uff0c\u4e14\u6ca1\u6709\u529e\u6cd5\u518d\u624b\u52a8\u56de\u6536\uff09\u3002<\/p>\n<pre><code>{\n    Complex* p = new Complex;\n\n    delete p;\n}<\/code><\/pre>\n<h4>new\u7684\u8fc7\u7a0b<\/h4>\n<ol>\n<li><strong>\u5148\u5206\u914d\u5185\u5b58<\/strong>\uff1a\u4f7f\u7528malloc\u51fd\u6570\uff0c\u5927\u5c0f\u4e3asizeof(\u5bf9\u8c61\u5927\u5c0f)\uff0c\u5bf9\u8c61\u5927\u5c0f\u662f\u6210\u5458\u53d8\u91cf\u51b3\u5b9a\u7684\uff0c\uff08\u4e0e\u6210\u5458\u51fd\u6570\u65e0\u5173\uff09\u3002\n<ol>\n<li>\u5982\u679c\u521b\u5efa\u5355\u4e2a\u5bf9\u8c61\uff1a\u5982Complex\u4e24\u4e2adouble\uff0c\u52198\u5b57\u8282\uff0c<strong>\u5934\u5c3e\u8981\u52a0\u4e0acookie\uff0c\u8868\u660e\u8be5\u90e8\u5206\u5185\u5b58\u5df2\u7ecf\u88ab\u5360\u7528\uff0c\u4e00\u4e2acookie\u4e3a4\u4e2a\u5b57\u8282\u3002\u5373release\u4e0b8+2*4 = 16\u5b57\u8282\uff08\u5fc5\u987b\u662f16\u5b57\u8282\u7684\u500d\u6570\uff0c\u5982\u679c\u4e0d\u8db3\u5219\u5411\u4e0a\u53d6\u6574\uff09\u3002debug\u4e0b\u5c31\u5f97\u518d\u52a032+4\uff0c\u5176\u5b9e\u6ca1\u5fc5\u8981\u8bb0\u3002<\/strong> <\/li>\n<li>\u5982\u679c\u521b\u5efa\u5bf9\u8c61\u6570\u7ec4\uff1a\u9664\u4e86\u8981n\u4efd\u6210\u5458\u53d8\u91cf\u4ee5\u5916\uff0c\u9700\u8981\u989d\u5916\u4e00\u4e2a\u5b57\u8282\u6765\u8bb0\u5f55\u6570\u7ec4\u7684\u5927\u5c0f\u3002**\u5373\u5982\u521b\u5efa\u957f\u5ea6\u4e3a3\u7684Complex\u6570\u7ec4\uff0crelease\u4e0b\uff1a8 * 3\uff08\u6210\u5458\u53d8\u91cf\uff09 +4 * 2 \uff08cookie\uff09+ 4 (\u8bb0\u5f55\u957f\u5ea6) = 36 -&gt; 48 **<\/li>\n<\/ol><\/li>\n<li>\u518d\u8c03\u7528\u6784\u9020\u51fd\u6570<\/li>\n<\/ol>","protected":false},"excerpt":{"rendered":"<p>\u672c\u7bc7\u5185\u5bb9 \u672c\u7bc7\u8bb0\u5f55\u7684\u662f\u3010\u4faf\u6377 &#8211; C++\u9762\u5411\u5bf9\u8c61\u9ad8\u7ea7\u5f00\u53d1\u3011\u5165\u95e8\u8bfe\u7a0b\u3002 \u672c\u8bfe\u7a0b\u4e00\u5171\u662f\u4e0a\u4e0b\u4e24\u90e8\u5206\uff0c\u4e0a\u90e8 [&hellip;]<\/p>","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[13],"class_list":["post-25","post","type-post","status-publish","format-standard","hentry","category-c","tag-c"],"_links":{"self":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts\/25","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=25"}],"version-history":[{"count":0,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=\/wp\/v2\/posts\/25\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=25"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=25"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cnsn.fun\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=25"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}