{"id":51242,"date":"2025-08-10T19:39:38","date_gmt":"2025-08-10T11:39:38","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/51242.html"},"modified":"2025-08-10T19:39:38","modified_gmt":"2025-08-10T11:39:38","slug":"%e5%b5%8c%e5%85%a5%e5%bc%8f%e8%bd%af%e4%bb%b6%e5%bc%80%e5%8f%91%e5%b7%a5%e7%a8%8b%e5%b8%88%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-1","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/51242.html","title":{"rendered":"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898---1"},"content":{"rendered":"<h6>1.C&#043;&#043; override\u5173\u952e\u5b57<\/h6>\n<p>\u5982\u679c\u6d3e\u751f\u7c7b\u5728\u865a\u51fd\u6570\u58f0\u660e\u65f6\u4f7f\u7528\u4e86override\u63cf\u8ff0\u7b26&#xff0c;\u90a3\u4e48\u8be5\u51fd\u6570\u5fc5\u987b\u91cd\u8f7d\u5176\u57fa\u7c7b\u4e2d\u7684\u540c\u540d\u51fd\u6570&#xff0c;\u5426\u5219\u4ee3\u7801\u5c06\u65e0\u6cd5\u901a\u8fc7\u7f16\u8bd1\u3002<\/p>\n<p>\u5982\u679c\u6d3e\u751f\u7c7b\u91cc\u9762\u662f\u50cf\u91cd\u8f7d\u865a\u51fd\u6570 \u5c31\u52a0\u4e0a\u5173\u952e\u5b57override \u8fd9\u6837\u7f16\u8bd1\u5668\u53ef\u4ee5\u8f85\u52a9\u68c0\u67e5\u662f\u4e0d\u662f\u6b63\u786e\u91cd\u8f7d&#xff0c;\u5982\u679c\u6ca1\u52a0\u8fd9\u4e2a\u5173\u952e\u5b57 \u4e5f\u6ca1\u4ec0\u4e48\u4e25\u91cd\u7684error \u53ea\u662f\u5c11\u4e86\u7f16\u8bd1\u5668\u68c0\u67e5\u7684\u5b89\u5168\u6027<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"107\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810113934-689884f689bc0.png\" width=\"417\" \/><\/p>\n<h6>2.\u5185\u6838\u5b89\u5168<\/h6>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"166\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810113935-689884f7a217d.png\" width=\"406\" \/><\/p>\n<h6>3.mallow\u548cnew\u7684\u533a\u522b<\/h6>\n<p>\u2460\u5c5e\u6027<\/p>\n<p>new\/delete\u662fC&#043;&#043;\u5173\u952e\u5b57&#xff0c;\u9700\u8981\u7f16\u8bd1\u5668\u652f\u6301\u3002malloc\/free\u662f\u5e93\u51fd\u6570&#xff0c;\u9700\u8981\u5934\u6587\u4ef6\u652f\u6301\u3002<\/p>\n<p>\u2461\u53c2\u6570<\/p>\n<p>\u4f7f\u7528new\u64cd\u4f5c\u7b26\u7533\u8bf7\u5185\u5b58\u5206\u914d\u65f6\u65e0\u987b\u6307\u5b9a\u5185\u5b58\u5757\u7684\u5927\u5c0f&#xff0c;\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u7c7b\u578b\u4fe1\u606f\u81ea\u884c\u8ba1\u7b97\u3002\u800cmalloc\u5219\u9700\u8981\u663e\u5f0f\u5730\u6307\u51fa\u6240\u9700\u5185\u5b58\u7684\u5c3a\u5bf8\u3002<\/p>\n<p>\u2462\u8fd4\u56de\u7c7b\u578b<\/p>\n<p>new\u64cd\u4f5c\u7b26\u5185\u5b58\u5206\u914d\u6210\u529f\u65f6&#xff0c;\u8fd4\u56de\u7684\u662f\u5bf9\u8c61\u7c7b\u578b\u7684\u6307\u9488&#xff0c;\u7c7b\u578b\u4e25\u683c\u4e0e\u5bf9\u8c61\u5339\u914d&#xff0c;\u65e0\u987b\u8fdb\u884c\u7c7b\u578b\u8f6c\u6362&#xff0c;\u6545new\u662f\u7b26\u5408\u7c7b\u578b\u5b89\u5168\u6027\u7684\u64cd\u4f5c\u7b26\u3002\u800cmalloc\u5185\u5b58\u5206\u914d\u6210\u529f\u5219\u662f\u8fd4\u56devoid * &#xff0c;\u9700\u8981\u901a\u8fc7\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\u5c06void*\u6307\u9488\u8f6c\u6362\u6210\u6211\u4eec\u9700\u8981\u7684\u7c7b\u578b\u3002<\/p>\n<p>\u2463\u5206\u914d\u5931\u8d25<\/p>\n<p>new\u5185\u5b58\u5206\u914d\u5931\u8d25\u65f6&#xff0c;\u4f1a\u629b\u51fabac_alloc\u5f02\u5e38\u3002malloc\u5206\u914d\u5185\u5b58\u5931\u8d25\u65f6\u8fd4\u56deNULL\u3002<\/p>\n<p>\u2464\u81ea\u5b9a\u4e49\u7c7b\u578b<\/p>\n<p>new\u4f1a\u5148\u8c03\u7528operator new\u51fd\u6570&#xff0c;\u7533\u8bf7\u8db3\u591f\u7684\u5185\u5b58&#xff08;\u901a\u5e38\u5e95\u5c42\u4f7f\u7528malloc\u5b9e\u73b0&#xff09;\u3002\u7136\u540e\u8c03\u7528\u7c7b\u578b\u7684\u6784\u9020\u51fd\u6570&#xff0c;\u521d\u59cb\u5316\u6210\u5458\u53d8\u91cf&#xff0c;\u6700\u540e\u8fd4\u56de\u81ea\u5b9a\u4e49\u7c7b\u578b\u6307\u9488\u3002delete\u5148\u8c03\u7528\u6790\u6784\u51fd\u6570&#xff0c;\u7136\u540e\u8c03\u7528operator delete\u51fd\u6570\u91ca\u653e\u5185\u5b58&#xff08;\u901a\u5e38\u5e95\u5c42\u4f7f\u7528free\u5b9e\u73b0&#xff09;\u3002<\/p>\n<p>malloc\/free\u662f\u5e93\u51fd\u6570&#xff0c;\u53ea\u80fd\u52a8\u6001\u7684\u7533\u8bf7\u548c\u91ca\u653e\u5185\u5b58&#xff0c;\u65e0\u6cd5\u5f3a\u5236\u8981\u6c42\u5176\u505a\u81ea\u5b9a\u4e49\u7c7b\u578b\u5bf9\u8c61\u6784\u9020\u548c\u6790\u6784\u5de5\u4f5c\u3002<\/p>\n<p>\u2465\u91cd\u8f7d<\/p>\n<p>C&#043;&#043;\u5141\u8bb8\u91cd\u8f7dnew\/delete\u64cd\u4f5c\u7b26&#xff0c;\u7279\u522b\u7684&#xff0c;\u5e03\u5c40new\u7684\u5c31\u4e0d\u9700\u8981\u4e3a\u5bf9\u8c61\u5206\u914d\u5185\u5b58&#xff0c;\u800c\u662f\u6307\u5b9a\u4e86\u4e00\u4e2a\u5730\u5740\u4f5c\u4e3a\u5185\u5b58\u8d77\u59cb\u533a\u57df&#xff0c;new\u5728\u8fd9\u6bb5\u5185\u5b58\u4e0a\u4e3a\u5bf9\u8c61\u8c03\u7528\u6784\u9020\u51fd\u6570\u5b8c\u6210\u521d\u59cb\u5316\u5de5\u4f5c&#xff0c;\u5e76\u8fd4\u56de\u6b64\u5730\u5740\u3002\u800cmalloc\u4e0d\u5141\u8bb8\u91cd\u8f7d\u3002<\/p>\n<p>\u2466\u5185\u5b58\u533a\u57df<\/p>\n<p>new\u64cd\u4f5c\u7b26\u4ece\u81ea\u7531\u5b58\u50a8\u533a&#xff08;free store&#xff09;\u4e0a\u4e3a\u5bf9\u8c61\u52a8\u6001\u5206\u914d\u5185\u5b58\u7a7a\u95f4&#xff0c;\u800cmalloc\u51fd\u6570\u4ece\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\u81ea\u7531\u5b58\u50a8\u533a\u662fC&#043;&#043;\u57fa\u4e8enew\u64cd\u4f5c\u7b26\u7684\u4e00\u4e2a\u62bd\u8c61\u6982\u5ff5&#xff0c;\u51e1\u662f\u901a\u8fc7new\u64cd\u4f5c\u7b26\u8fdb\u884c\u5185\u5b58\u7533\u8bf7&#xff0c;\u8be5\u5185\u5b58\u5373\u4e3a\u81ea\u7531\u5b58\u50a8\u533a\u3002\u800c\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u672f\u8bed&#xff0c;\u662f\u64cd\u4f5c\u7cfb\u7edf\u6240\u7ef4\u62a4\u7684\u4e00\u5757\u7279\u6b8a\u5185\u5b58&#xff0c;\u7528\u4e8e\u7a0b\u5e8f\u7684\u5185\u5b58\u52a8\u6001\u5206\u914d&#xff0c;C\u8bed\u8a00\u4f7f\u7528malloc\u4ece\u5806\u4e0a\u5206\u914d\u5185\u5b58&#xff0c;\u4f7f\u7528free\u91ca\u653e\u5df2\u5206\u914d\u7684\u5bf9\u5e94\u5185\u5b58\u3002\u81ea\u7531\u5b58\u50a8\u533a\u4e0d\u7b49\u4e8e\u5806&#xff0c;\u5982\u4e0a\u6240\u8ff0&#xff0c;\u5e03\u5c40new\u5c31\u53ef\u4ee5\u4e0d\u4f4d\u4e8e\u5806\u4e2d\u3002<\/p>\n<p>malloc \u7684\u5e95\u5c42\u5b9e\u73b0\u662f\u7cfb\u7edf\u8c03\u7528\u51fd\u6570 brk&#xff08;&#xff09;&#xff0c;\u5176\u4e3b\u8981\u79fb\u52a8\u6307\u9488 _enddata(\u6b64\u65f6\u7684 _enddata \u6307\u7684\u662f Linux \u5730\u5740\u7a7a\u95f4\u4e2d\u5806\u6bb5\u7684\u672b\u5c3e\u5730\u5740&#xff0c;\u4e0d\u662f\u6570\u636e\u6bb5\u7684\u672b\u5c3e\u5730\u5740)<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">malloc\u4e0d\u5141\u8bb8\u91cd\u8f7d\u7684\u539f\u56e0&#xff1a; \u603b\u7ed3\u6765\u8bf4&#xff0c;malloc \u4e0d\u5141\u8bb8\u91cd\u8f7d\u7684\u539f\u56e0\u662f C \u8bed\u8a00\u4e0d\u652f\u6301\u51fd\u6570\u91cd\u8f7d&#xff0c;\u800c malloc \u672c\u8eab\u7684\u5b9a\u4e49\u662f\u6807\u51c6\u5316\u7684\u3001\u4e0d\u53ef\u66f4\u6539\u7684\u3002\u5982\u679c\u9700\u8981\u81ea\u5b9a\u4e49\u7684\u5185\u5b58\u5206\u914d\u884c\u4e3a&#xff0c;\u53ef\u4ee5\u901a\u8fc7\u5c01\u88c5\u51fd\u6570\u5b9e\u73b0\u3002<\/span><\/p>\n<h6>4.vector\u6269\u5bb9<\/h6>\n<p>\u6211\u4eec\u77e5\u9053\u52a8\u6001\u6570\u7ec4\u662f\u53ef\u4ee5\u52a8\u6001\u5730\u63d2\u5165\u5220\u9664\u6570\u636e&#xff0c;\u4f46\u662f\u52a8\u6001\u6570\u7ec4\u4e5f\u662f\u9884\u8bbe\u4e86\u6570\u7ec4\u5927\u5c0f&#xff0c;\u5728\u5927\u5c0f\u4e0d\u591f\u7684\u65f6\u5019&#xff08;size &#061; capacity&#xff09;&#xff0c;\u4f1a\u7533\u8bf7\u4e00\u5757\u66f4\u5927\u7684\u65b0\u5185\u5b58&#xff0c;\u8fdb\u884c\u6570\u7ec4\u6269\u5bb9\u3002<\/p>\n<p>\u8d77\u59cb\u5bb9\u91cf\u4e3a0&#xff0c;GCC \u662f 2 \u500d\u6269\u5bb9&#xff0c;\u5373\u4e4b\u540e\u63d2\u5165\u6309\u7167 1 2 4 8 16 \u4e8c\u500d\u6269\u5bb9&#xff0c;VS13 \u662f 1.5 \u500d\u6269\u5bb9\u3002\u6269\u5bb9\u540e\u662f\u4e00\u7247\u65b0\u7684\u5185\u5b58&#xff0c;\u9700\u8981\u628a\u65e7\u5185\u5b58\u7a7a\u95f4\u4e2d\u7684\u6240\u6709\u5143\u7d20\u90fd\u62f7\u8d1d\u8fdb\u65b0\u5185\u5b58\u7a7a\u95f4\u4e2d\u53bb&#xff0c;\u4e4b\u540e\u518d\u5728\u65b0\u5185\u5b58\u7a7a\u95f4\u4e2d\u7684\u539f\u6570\u636e\u7684\u540e\u9762\u7ee7\u7eed\u8fdb\u884c\u63d2\u5165\u6784\u9020\u65b0\u5143\u7d20&#xff0c;\u5e76\u4e14\u540c\u65f6\u91ca\u653e\u65e7\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u4e14&#xff0c;\u7531\u4e8e vector \u7a7a\u95f4\u7684\u91cd\u65b0\u914d\u7f6e&#xff0c;\u5bfc\u81f4\u65e7 vector \u7684\u6240\u6709\u8fed\u4ee3\u5668\u90fd\u5931\u6548\u4e86\u3002<\/p>\n<h6>5.\u591a\u8fdb\u7a0b\u5171\u4eab\u52a8\u6001\u94fe\u63a5\u5e93<\/h6>\n<p>\u8fdb\u7a0b\u5171\u4eab\u52a8\u6001\u94fe\u63a5\u5e93&#xff08;Dynamic Link Library&#xff0c;\u7b80\u79f0 DLL \u6216 .so \u6587\u4ef6&#xff09;\u662f\u73b0\u4ee3\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u5e38\u89c1\u7684\u5185\u5b58\u7ba1\u7406\u673a\u5236&#xff0c;\u5141\u8bb8\u591a\u4e2a\u8fdb\u7a0b\u540c\u65f6\u4f7f\u7528\u540c\u4e00\u4e2a\u5e93\u4e2d\u7684\u4ee3\u7801\u6216\u8d44\u6e90&#xff0c;\u800c\u65e0\u9700\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u521b\u5efa\u72ec\u7acb\u7684\u526f\u672c\u3002\u8fd9\u79cd\u5171\u4eab\u673a\u5236\u80fd\u591f\u8282\u7701\u5185\u5b58&#xff0c;\u63d0\u9ad8\u7cfb\u7edf\u6027\u80fd\u3002<\/p>\n<h6>6.\u6790\u6784\u51fd\u6570\u4e3a\u4ec0\u4e48\u662f\u865a\u51fd\u6570<\/h6>\n<p>\u5728C&#043;&#043;\u4e2d&#xff0c;\u6790\u6784\u51fd\u6570\u88ab\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u7684\u539f\u56e0\u4e3b\u8981\u662f\u4e3a\u4e86\u786e\u4fdd\u57fa\u7c7b\u6307\u9488\u6216\u5f15\u7528\u00a0\u6307\u5411\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6&#xff0c;\u80fd\u591f\u6b63\u786e\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u5177\u4f53\u6765\u8bf4&#xff0c;\u5982\u679c\u4e00\u4e2a\u7c7b\u6709\u865a\u51fd\u6570&#xff0c;\u5b83\u901a\u5e38\u4e5f\u5e94\u8be5\u5c06\u6790\u6784\u51fd\u6570\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u3002<\/p>\n<p>\u5982\u679c\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570&#xff0c;\u5f53\u4f60\u901a\u8fc7\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u5220\u9664\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6&#xff0c;\u53ea\u4f1a\u8c03\u7528\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u800c\u4e0d\u4f1a\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u8fd9\u4f1a\u5bfc\u81f4\u6d3e\u751f\u7c7b\u4e2d\u52a8\u6001\u5206\u914d\u7684\u8d44\u6e90\u6ca1\u6709\u88ab\u6b63\u786e\u91ca\u653e&#xff0c;\u8fdb\u800c\u5f15\u53d1\u5185\u5b58\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002<\/p>\n<h6>7.vector\u548carray\u7684\u533a\u522b<\/h6>\n<p>\u90fd\u80fd\u7528\u4e0b\u6807\u6765\u8bbf\u95ee\u5143\u7d20\u3002<\/p>\n<p>\u90fd\u662f\u987a\u5e8f\u5bb9\u5668&#xff0c;\u91c7\u7528\u7684\u662f\u987a\u5e8f\u7684\u5b58\u50a8\u7a7a\u95f4\u3002<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">\u521b\u5efa\u65b9\u5f0f\u4e0a\u4e0d\u540c&#xff1a;<\/span><\/p>\n<p>vector\u65e0\u9700\u6307\u5b9a\u5927\u5c0f&#xff0c;\u53ea\u9700\u6307\u5b9a\u7c7b\u578b&#xff0c;e.g. vector&lt;int&gt; a\u3002<\/p>\n<p>array\u9700\u8981\u540c\u65f6\u6307\u5b9a\u7c7b\u578b\u548c\u5927\u5c0f&#xff0c;e.g. array&lt;int, 3&gt; a\u3002<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">\u5185\u5b58\u4f7f\u7528\u4e0a\u4e0d\u540c&#xff1a;<\/span><\/p>\n<p>vector\u9700\u8981\u5360\u636e\u6bd4array\u66f4\u591a\u7684\u5185\u5b58&#xff0c;\u56e0\u4e3a\u5176\u5185\u5b58\u7a7a\u95f4\u5927\u5c0f\u662f\u52a8\u6001\u53ef\u53d8\u7684\u3002<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">\u6548\u7387\u4e0a\u4e0d\u540c&#xff1a;<\/span><\/p>\n<p>vector\u6548\u7387\u504f\u4f4e&#xff0c;\u56e0\u4e3a\u5f53\u5411vector\u4e2d\u6dfb\u52a0\u65b0\u5143\u7d20\u7684\u65f6\u5019&#xff0c;\u5185\u5b58\u7a7a\u95f4\u4e0d\u591f&#xff0c;\u9700\u8981\u91cd\u65b0\u7533\u8bf7\u66f4\u5927\u7684\u7a7a\u95f4&#xff0c;\u7531\u4e8evector\u662f\u8fde\u7eed\u5185\u5b58\u7a7a\u95f4\u7684&#xff0c;\u56e0\u6b64\u5176\u7533\u8bf7\u66f4\u591a\u7a7a\u95f4\u7684\u65f6\u5019&#xff0c;\u53ef\u80fd\u6574\u4e2a\u4f4d\u7f6e\u53d1\u751f\u6539\u53d8&#xff0c;\u9700\u8981\u5c06\u539f\u6765\u7a7a\u95f4\u91cc\u7684\u6570\u636e\u62f7\u8d1d\u8fc7\u53bb\u3002<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">\u4e0b\u6807\u7c7b\u578b\u4e0d\u540c&#xff1a;<\/span><\/p>\n<p>\u5728\u7528\u4e0b\u6807\u8bbf\u95ee\u5143\u7d20\u65f6&#xff0c;vector \u4f7f\u7528 vector::size_type \u4f5c\u4e3a\u4e0b\u6807\u7684\u7c7b\u578b&#xff0c;\u800c\u6570\u7ec4\u4e0b\u6807\u7684\u6b63\u786e\u7c7b\u578b\u5219\u662f size_t&#xff1b;<\/p>\n<\/p>\n<p><span style=\"color:#fe2c24\">swap\u64cd\u4f5c\u4e0d\u540c&#xff1a;<\/span><\/p>\n<p>vector\u662f\u5c06\u5f15\u7528\u8fdb\u884c\u4ea4\u6362&#xff0c;\u6548\u7387\u9ad8&#xff0c;\u5176\u8fed\u4ee3\u5668\u6307\u5411\u539f\u6765\u7684\u5bb9\u5668&#xff08;\u539f\u6765\u7684\u5bb9\u5668\u4e2d\u7684\u5143\u7d20\u6307\u5411\u7684\u5374\u662f\u53e6\u4e00\u4e2a\u5bb9\u5668\u7684\u503c&#xff09;&#xff0c;\u4f46\u662fend\u7684\u5f15\u7528\u5e76\u6ca1\u6709\u53d1\u751f\u4ea4\u6362&#xff0c;\u56e0\u6b64\u5728\u8f93\u51fa\u7684\u65f6\u5019\u6ce8\u610f\u522b\u7528end\u4f5c\u4e3a\u8fed\u4ee3\u7ec8\u6b62\u6761\u4ef6\u3002<\/p>\n<p>array\u662f\u8fdb\u884c\u503c\u7684\u4ea4\u6362&#xff0c;\u6548\u7387\u4f4e&#xff0c;\u4e14\u8fed\u4ee3\u5668\u4ecd\u6307\u5411\u539f\u6765\u7684\u5bb9\u5668\u3002<\/p>\n<h6>8.\u9759\u6001\u94fe\u63a5\u548c\u52a8\u6001\u94fe\u63a5\u7684\u533a\u522b&#xff1f;<\/h6>\n<p>\u9759\u6001\u94fe\u63a5\u5e93\u662f.lib\u683c\u5f0f\u7684\u6587\u4ef6&#xff0c;\u4e00\u822c\u5728\u5de5\u7a0b\u7684\u8bbe\u7f6e\u754c\u9762\u52a0\u5165\u5de5\u7a0b\u4e2d&#xff0c;\u7a0b\u5e8f\u7f16\u8bd1\u65f6\u4f1a\u628alib\u6587\u4ef6\u7684\u4ee3\u7801\u76f4\u63a5\u94fe\u63a5\u8fdb\u76ee\u6807\u7a0b\u5e8f\u4e2d&#xff0c;\u56e0\u6b64\u4f1a\u589e\u52a0\u4ee3\u7801\u5927\u5c0f&#xff0c;\u9759\u6001\u94fe\u63a5\u7684\u53ef\u6267\u884c\u6587\u4ef6\u4f1a\u5927\u4e00\u4e9b&#xff0c;\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u4e0d\u518d\u9700\u8981\u5176\u5b83\u7684\u5e93\u6587\u4ef6&#xff0c;\u4e0d\u80fd\u624b\u52a8\u79fb\u9664lib\u4ee3\u7801\u3002<\/p>\n<p>\u52a8\u6001\u94fe\u63a5\u5e93\u662f\u4e00\u4e2a\u5305\u542b\u53ef\u7531\u591a\u4e2a\u7a0b\u5e8f\u540c\u65f6\u4f7f\u7528\u7684\u4ee3\u7801\u548c\u6570\u636e\u7684\u5e93&#xff0c;\u5b83\u662f\u5305\u542b\u51fd\u6570\u548c\u6570\u636e\u7684\u6a21\u5757&#xff0c;\u683c\u5f0f.dll\u3002\u7a0b\u5e8f\u8fd0\u884c\u65f6\u52a8\u6001\u52a0\u8f7d\u8fd9\u4e9b\u6a21\u5757&#xff0c;\u8fd0\u884c\u65f6\u53ef\u4ee5\u968f\u610f\u52a0\u8f7d\u548c\u79fb\u9664&#xff0c;\u8282\u7701\u5185\u5b58\u7a7a\u95f4\u3002<\/p>\n<p><span style=\"color:#956fe7\">\u52a8\u6001\u94fe\u63a5\u5e93\u548c\u9759\u6001\u94fe\u63a5\u5e93\u7684\u76f8\u540c\u70b9\u662f\u5b83\u4eec\u90fd\u5b9e\u73b0\u4e86\u4ee3\u7801\u7684\u5171\u4eab&#xff0c;\u4e0d\u540c\u70b9\u662f\u9759\u6001\u94fe\u63a5\u5e93lib\u6587\u4ef6\u4e2d\u7684\u4ee3\u7801\u88ab\u5305\u542bexe\u6587\u4ef6\u4e2d&#xff0c;\u8be5lib\u4e2d\u4e0d\u80fd\u518d\u5305\u542b\u5176\u4ed6\u52a8\u6001\u94fe\u63a5\u6216\u8005\u9759\u6001\u94fe\u63a5\u7684\u5e93\u4e86\u3002\u800c\u52a8\u6001\u94fe\u63a5\u5e93dll\u53ef\u4ee5\u88ab\u8c03\u7528\u7684exe\u52a8\u6001\u5730\u201c\u5f15\u7528\u201d\u548c\u201c\u5378\u8f7d\u201d&#xff0c;\u4e00\u4e2adll\u4e2d\u53ef\u4ee5\u5305\u542b\u5176\u4ed6\u52a8\u6001\u94fe\u63a5\u5e93\u6216\u8005\u9759\u6001\u94fe\u63a5\u5e93\u3002<\/span><\/p>\n<h6>9.\u5de6\u503c\u548c\u53f3\u503c<\/h6>\n<p>\u5de6\u503c&#xff08;lvalue&#xff09;\u662f\u8868\u8fbe\u5f0f\u7ed3\u675f\u540e\u4f9d\u7136\u5b58\u5728\u7684\u6301\u4e45\u5bf9\u8c61&#xff0c;\u53ef\u4ee5\u51fa\u73b0\u5728\u8d4b\u503c\u8868\u8fbe\u5f0f\u7684\u5de6\u8fb9\u6216\u53f3\u8fb9&#xff0c;\u53f3\u503c&#xff08;rvalue&#xff09;\u662f\u8868\u8fbe\u5f0f\u7ed3\u675f\u540e\u5c31\u4e0d\u518d\u5b58\u5728\u7684\u4e34\u65f6\u5bf9\u8c61&#xff0c;\u4e0d\u80fd\u51fa\u73b0\u5728\u8d4b\u503c\u8868\u8fbe\u5f0f\u7684\u5de6\u8fb9\u3002\u5de6\u503c\u53ef\u4ee5\u53d6\u5730\u5740&#xff0c;\u53f3\u503c\u4e0d\u80fd\u53d6\u5730\u5740\u3002<\/p>\n<h6>10.NULL\u548cnullptr\u7684\u533a\u522b&#xff1f;<\/h6>\n<table>\n<tbody>\n<tr>\n<td>\n<p>\u7279\u6027<\/p>\n<\/td>\n<td>\n<p>NULL<\/p>\n<\/td>\n<td>\n<p>nullptr<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u5b9a\u4e49<\/p>\n<\/td>\n<td>\n<p>\u5b8f&#xff0c;\u901a\u5e38\u5b9a\u4e49\u4e3a 0<\/p>\n<\/td>\n<td>\n<p>\u5173\u952e\u5b57&#xff0c;\u7c7b\u578b\u4e3a std::nullptr_t<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u7c7b\u578b<\/p>\n<\/td>\n<td>\n<p>\u6574\u6570\u5e38\u91cf<\/p>\n<\/td>\n<td>\n<p>\u7a7a\u6307\u9488\u7c7b\u578b<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u7c7b\u578b\u5b89\u5168<\/p>\n<\/td>\n<td>\n<p>\u5426&#xff0c;\u4f1a\u9690\u5f0f\u8f6c\u6362\u4e3a\u6574\u6570<\/p>\n<\/td>\n<td>\n<p>\u662f&#xff0c;\u53ea\u80fd\u7528\u4e8e\u6307\u9488<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u4f7f\u7528\u573a\u666f<\/p>\n<\/td>\n<td>\n<p>C \u548c\u65e7\u7248 C&#043;&#043; \u4e2d\u7684\u7a7a\u6307\u9488<\/p>\n<\/td>\n<td>\n<p>C&#043;&#043;11 \u53ca\u4ee5\u540e\u7684\u7a7a\u6307\u9488<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p>\u51fd\u6570\u91cd\u8f7d\u95ee\u9898<\/p>\n<\/td>\n<td>\n<p>\u53ef\u80fd\u5bfc\u81f4\u6b67\u4e49<\/p>\n<\/td>\n<td>\n<p>\u4e0d\u4f1a\u5bfc\u81f4\u6b67\u4e49<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"color:#be191c\">\u5728\u73b0\u4ee3C&#043;&#043;\u7f16\u7a0b\u4e2d&#xff0c;\u5efa\u8bae\u59cb\u7ec8\u4f7f\u7528 nullptr \u800c\u4e0d\u662f NULL&#xff0c;\u56e0\u4e3a nullptr \u63d0\u4f9b\u4e86\u66f4\u5f3a\u7684\u7c7b\u578b\u5b89\u5168\u6027&#xff0c;\u907f\u514d\u4e86\u7531 NULL \u5f15\u53d1\u7684\u7c7b\u578b\u4e0d\u5339\u914d\u95ee\u9898&#xff0c;\u5c24\u5176\u5728\u6a21\u677f\u548c\u51fd\u6570\u91cd\u8f7d\u7b49\u573a\u666f\u4e0b\u3002<\/span><\/p>\n<p>\u603b\u7ed3&#xff1a;NULL \u662f\u4e00\u4e2a\u6574\u6570\u5e38\u91cf&#xff0c;\u7c7b\u578b\u4e0d\u5b89\u5168&#xff0c;\u800c nullptr \u662fC&#043;&#043;11\u5f15\u5165\u7684\u4e13\u95e8\u8868\u793a\u7a7a\u6307\u9488\u7684\u5173\u952e\u5b57&#xff0c;\u7c7b\u578b\u5b89\u5168&#xff0c;\u5efa\u8bae\u5728C&#043;&#043;\u4ee3\u7801\u4e2d\u4f18\u5148\u4f7f\u7528 nullptr\u3002<\/p>\n<p>nullptr \u662f C&#043;&#043;11 \u5f15\u5165\u7684\u5173\u952e\u5b57&#xff0c;\u7528\u6765\u8868\u793a\u7a7a\u6307\u9488&#xff0c;\u5b83\u8868\u793a\u6307\u9488\u6ca1\u6709\u6307\u5411\u4efb\u4f55\u6709\u6548\u5185\u5b58\u5730\u5740\u3002<\/p>\n<h6>11.\u00a0\u539f\u5b50\u53d8\u91cf\u4f1a\u5f15\u8d77\u6b7b\u9501\u5417&#xff1f;<\/h6>\n<p>\u539f\u5b50\u53d8\u91cf\u901a\u8fc7\u786c\u4ef6\u63d0\u4f9b\u7684\u539f\u5b50\u64cd\u4f5c\u5b9e\u73b0\u65e0\u9501\u540c\u6b65&#xff0c;\u4e0d\u4f1a\u5f15\u53d1\u6b7b\u9501\u3002<\/p>\n<p>\u539f\u5b50\u53d8\u91cf\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u7528\u4e8e\u6267\u884c\u539f\u5b50\u64cd\u4f5c\u3002\u539f\u5b50\u64cd\u4f5c\u662f\u4e0d\u53ef\u5206\u5272\u7684\u64cd\u4f5c&#xff0c;\u53ef\u4ee5\u786e\u4fdd\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d\u7ebf\u7a0b\u5b89\u5168\u5730\u6267\u884c\u3002C&#043;&#043;\u4e2d\u7684std::atomic\u63d0\u4f9b\u4e86\u5bf9\u539f\u5b50\u64cd\u4f5c\u7684\u652f\u6301\u3002\u4e00\u4e2a\u72ec\u7acb\u4e0d\u53ef\u5206\u5272\u7684\u64cd\u4f5c\u3002\u591a\u7ebf\u7a0b\u7f16\u7a0b\u9700\u8981\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168&#xff0c;\u800c\u7ebf\u7a0b\u5b89\u5168\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u7279\u6027\u5c31\u662f\u539f\u5b50\u6027&#xff0c;\u5373\u5728\u540c\u4e00\u65f6\u523b\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u539f\u5b50\u8fdb\u884c\u64cd\u4f5c&#xff0c;\u4fdd\u8bc1\u6570\u636e\u8bbf\u95ee\u7684\u4e92\u65a5\u6027\u3002<\/p>\n<p>\u539f\u5b50\u64cd\u4f5c&#xff1a;<\/p>\n<p>\u539f\u5b50\u64cd\u4f5c\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u4e2d\u7684\u6982\u5ff5&#xff0c;\u6307\u7684\u662f\u5728\u6267\u884c\u671f\u95f4\u4e0d\u80fd\u88ab\u4e2d\u65ad\u7684\u4e00\u7ec4\u64cd\u4f5c\u3002\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e2d&#xff0c;\u786e\u4fdd\u539f\u5b50\u64cd\u4f5c\u7684\u6267\u884c\u662f\u4e0d\u53ef\u5206\u5272\u7684&#xff0c;\u8981\u4e48\u5b8c\u5168\u6267\u884c&#xff0c;\u8981\u4e48\u5b8c\u5168\u4e0d\u6267\u884c\u3002\u8fd9\u79cd\u7279\u6027\u4f7f\u5f97\u5728\u5e76\u53d1\u7f16\u7a0b\u4e2d\u66f4\u5bb9\u6613\u7ba1\u7406\u5171\u4eab\u8d44\u6e90&#xff0c;\u907f\u514d\u7ade\u6001\u6761\u4ef6\u548c\u6570\u636e\u4e0d\u4e00\u81f4\u3002<\/p>\n<h6>12.\u624b\u6495\u4ee3\u7801&#xff1a;\u591a\u7ebf\u7a0b\u5faa\u73af\u6253\u5370123<\/h6>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;pthread.h&gt;<\/p>\n<p>#define LOOP_COUNT 5  \/\/ \u5b9a\u4e49\u5faa\u73af\u6b21\u6570<\/p>\n<p>pthread_mutex_t mutex;<br \/>\npthread_cond_t cond;<br \/>\nint current_num &#061; 1;<\/p>\n<p>void* print_num(void* arg) {<br \/>\n    int num &#061; *(int*)arg;<\/p>\n<p>    for (int i &#061; 0; i &lt; LOOP_COUNT; i&#043;&#043;) {<br \/>\n        pthread_mutex_lock(&amp;mutex);  \/\/ \u52a0\u9501<\/p>\n<p>        while (current_num !&#061; num) {<br \/>\n            pthread_cond_wait(&amp;cond, &amp;mutex);  \/\/ \u7b49\u5f85\u6761\u4ef6\u53d8\u91cf<br \/>\n        }<\/p>\n<p>        printf(&#034;%d &#034;, num);  \/\/ \u8f93\u51fa\u5f53\u524d\u6570\u5b57<\/p>\n<p>        \/\/ \u66f4\u65b0\u4e0b\u4e00\u4e2a\u8981\u8f93\u51fa\u7684\u6570\u5b57<br \/>\n        current_num &#061; current_num % 3 &#043; 1;<br \/>\n        pthread_cond_broadcast(&amp;cond);  \/\/ \u5e7f\u64ad\u5524\u9192\u6240\u6709\u7b49\u5f85\u7684\u7ebf\u7a0b<\/p>\n<p>        pthread_mutex_unlock(&amp;mutex);  \/\/ \u89e3\u9501<br \/>\n    }<\/p>\n<p>    return NULL;<br \/>\n}<\/p>\n<p>int main() {<br \/>\n    pthread_t tid1, tid2, tid3;<br \/>\n    pthread_mutex_init(&amp;mutex, NULL);  \/\/ \u521d\u59cb\u5316\u4e92\u65a5\u9501<br \/>\n    pthread_cond_init(&amp;cond, NULL);    \/\/ \u521d\u59cb\u5316\u6761\u4ef6\u53d8\u91cf<\/p>\n<p>    int num1 &#061; 1, num2 &#061; 2, num3 &#061; 3;<\/p>\n<p>    \/\/ \u521b\u5efa\u4e09\u4e2a\u7ebf\u7a0b<br \/>\n    pthread_create(&amp;tid1, NULL, print_num, &amp;num1);<br \/>\n    pthread_create(&amp;tid2, NULL, print_num, &amp;num2);<br \/>\n    pthread_create(&amp;tid3, NULL, print_num, &amp;num3);<\/p>\n<p>    \/\/ \u7b49\u5f85\u7ebf\u7a0b\u7ed3\u675f<br \/>\n    pthread_join(tid1, NULL);<br \/>\n    pthread_join(tid2, NULL);<br \/>\n    pthread_join(tid3, NULL);<\/p>\n<p>    pthread_mutex_destroy(&amp;mutex);  \/\/ \u9500\u6bc1\u4e92\u65a5\u9501<br \/>\n    pthread_cond_destroy(&amp;cond);    \/\/ \u9500\u6bc1\u6761\u4ef6\u53d8\u91cf<br \/>\n    return 0;<br \/>\n}<\/p>\n<h6>13.\u4ea4\u53c9\u94fe\u8868<\/h6>\n<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<\/p>\n<p>struct ListNode {<br \/>\n    int val;<br \/>\n    struct ListNode *next;<br \/>\n};<\/p>\n<p>struct ListNode *getsamenode(struct ListNode *headA, struct ListNode *headB) {<br \/>\n    if (headA &#061;&#061; NULL || headB &#061;&#061; NULL) return NULL;<\/p>\n<p>    struct ListNode *PA &#061; headA, *PB &#061; headB;<\/p>\n<p>    \/\/ \u4e24\u4e2a\u6307\u9488\u4e0d\u65ad\u79fb\u52a8&#xff0c;\u76f4\u5230\u5b83\u4eec\u76f8\u7b49\u6216\u90fd\u4e3aNULL<br \/>\n    while (PA !&#061; PB) {<br \/>\n        PA &#061; (PA &#061;&#061; NULL) ? headB : PA-&gt;next;<br \/>\n        PB &#061; (PB &#061;&#061; NULL) ? headA : PB-&gt;next;<br \/>\n    }<br \/>\n    return PA;  \/\/ \u8fd4\u56de\u76f8\u4ea4\u7684\u7ed3\u70b9&#xff0c;\u6216NULL\u8868\u793a\u4e0d\u76f8\u4ea4<br \/>\n}<\/p>\n<p>struct ListNode *create(int val) {<br \/>\n    struct ListNode *newnode &#061; (struct ListNode *)malloc(sizeof(struct ListNode));<br \/>\n    newnode-&gt;val &#061; val;<br \/>\n    newnode-&gt;next &#061; NULL;<br \/>\n    return newnode;<br \/>\n}<\/p>\n<p>int main() {<br \/>\n    \/\/ \u521b\u5efa\u4e24\u4e2a\u94fe\u8868<br \/>\n    struct ListNode *headA &#061; create(1);<br \/>\n    headA-&gt;next &#061; create(2);<br \/>\n    headA-&gt;next-&gt;next &#061; create(3);<br \/>\n    headA-&gt;next-&gt;next-&gt;next &#061; create(4);<br \/>\n    headA-&gt;next-&gt;next-&gt;next-&gt;next &#061; create(5);<\/p>\n<p>    struct ListNode *headB &#061; create(9);<br \/>\n    headB-&gt;next &#061; create(8);<\/p>\n<p>    \/\/ \u6a21\u62df\u94fe\u8868\u76f8\u4ea4&#xff0c;\u4eceheadB\u7684\u7ed3\u70b98\u5f00\u59cb\u4e0eheadA\u7684\u7ed3\u70b93\u76f8\u4ea4<br \/>\n    headB-&gt;next-&gt;next &#061; headA-&gt;next-&gt;next; \/\/ \u8ba9\u4e24\u4e2a\u94fe\u8868\u5728\u8282\u70b93\u76f8\u4ea4<\/p>\n<p>    \/\/ \u6253\u5370\u4e24\u4e2a\u94fe\u8868<br \/>\n    struct ListNode *current &#061; headA;<br \/>\n    while (current !&#061; NULL) {<br \/>\n        printf(&#034;ListA: %d\\\\n&#034;, current-&gt;val);<br \/>\n        current &#061; current-&gt;next;<br \/>\n    }<\/p>\n<p>    struct ListNode *current2 &#061; headB;<br \/>\n    while (current2 !&#061; NULL) {<br \/>\n        printf(&#034;ListB: %d\\\\n&#034;, current2-&gt;val);<br \/>\n        current2 &#061; current2-&gt;next;<br \/>\n    }<\/p>\n<p>    \/\/ \u67e5\u627e\u76f8\u4ea4\u7684\u8282\u70b9<br \/>\n    struct ListNode *interaction &#061; getsamenode(headA, headB);<br \/>\n    if (interaction !&#061; NULL)<br \/>\n        printf(&#034;Intersecting Node: %d\\\\n&#034;, interaction-&gt;val);<br \/>\n    else<br \/>\n        printf(&#034;No intersection\\\\n&#034;);<\/p>\n<p>    return 0;<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb630\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728C++\u4e2d\uff0c\u6790\u6784\u51fd\u6570\u88ab\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u7684\u539f\u56e0\u4e3b\u8981\u662f\u4e3a\u4e86\u786e\u4fdd\u57fa\u7c7b\u6307\u9488\u6216\u5f15\u7528 \u6307\u5411\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u80fd\u591f\u6b63\u786e\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u4e00\u4e2a\u7c7b\u6709\u865a\u51fd\u6570\uff0c\u5b83\u901a\u5e38\u4e5f\u5e94\u8be5\u5c06\u6790\u6784\u51fd\u6570\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u3002\u5982\u679c\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570\uff0c\u5f53\u4f60\u901a\u8fc7\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u5220\u9664\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u53ea\u4f1a\u8c03\u7528\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u800c\u4e0d\u4f1a\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u8fd9\u4f1a\u5bfc\u81f4\u6d3e\u751f\u7c7b\u4e2d\u52a8\u6001\u5206\u914d\u7684\u8d44\u6e90\u6ca1\u6709\u88ab\u6b63\u786e\u91ca\u653e\uff0c\u8fdb\u800c\u5f15\u53d1\u5185\u5b58\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002<\/p>\n","protected":false},"author":2,"featured_media":51240,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[925,176],"topic":[],"class_list":["post-51242","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-925","tag-176"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \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\/51242.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb630\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728C++\u4e2d\uff0c\u6790\u6784\u51fd\u6570\u88ab\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u7684\u539f\u56e0\u4e3b\u8981\u662f\u4e3a\u4e86\u786e\u4fdd\u57fa\u7c7b\u6307\u9488\u6216\u5f15\u7528 \u6307\u5411\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u80fd\u591f\u6b63\u786e\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u4e00\u4e2a\u7c7b\u6709\u865a\u51fd\u6570\uff0c\u5b83\u901a\u5e38\u4e5f\u5e94\u8be5\u5c06\u6790\u6784\u51fd\u6570\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u3002\u5982\u679c\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570\uff0c\u5f53\u4f60\u901a\u8fc7\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u5220\u9664\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u53ea\u4f1a\u8c03\u7528\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u800c\u4e0d\u4f1a\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u8fd9\u4f1a\u5bfc\u81f4\u6d3e\u751f\u7c7b\u4e2d\u52a8\u6001\u5206\u914d\u7684\u8d44\u6e90\u6ca1\u6709\u88ab\u6b63\u786e\u91ca\u653e\uff0c\u8fdb\u800c\u5f15\u53d1\u5185\u5b58\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/51242.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-08-10T11:39:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810113934-689884f689bc0.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=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51242.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/51242.html\",\"name\":\"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-08-10T11:39:38+00:00\",\"dateModified\":\"2025-08-10T11:39:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/51242.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/51242.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/51242.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898---1\"}]},{\"@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":"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \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\/51242.html","og_locale":"zh_CN","og_type":"article","og_title":"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb630\u6b21\uff0c\u70b9\u8d5e11\u6b21\uff0c\u6536\u85cf2\u6b21\u3002\u5728C++\u4e2d\uff0c\u6790\u6784\u51fd\u6570\u88ab\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u7684\u539f\u56e0\u4e3b\u8981\u662f\u4e3a\u4e86\u786e\u4fdd\u57fa\u7c7b\u6307\u9488\u6216\u5f15\u7528 \u6307\u5411\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u80fd\u591f\u6b63\u786e\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u5177\u4f53\u6765\u8bf4\uff0c\u5982\u679c\u4e00\u4e2a\u7c7b\u6709\u865a\u51fd\u6570\uff0c\u5b83\u901a\u5e38\u4e5f\u5e94\u8be5\u5c06\u6790\u6784\u51fd\u6570\u58f0\u660e\u4e3a\u865a\u51fd\u6570\u3002\u5982\u679c\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570\uff0c\u5f53\u4f60\u901a\u8fc7\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u5220\u9664\u6d3e\u751f\u7c7b\u5bf9\u8c61\u65f6\uff0c\u53ea\u4f1a\u8c03\u7528\u57fa\u7c7b\u7684\u6790\u6784\u51fd\u6570\u800c\u4e0d\u4f1a\u8c03\u7528\u6d3e\u751f\u7c7b\u7684\u6790\u6784\u51fd\u6570\u3002\u8fd9\u4f1a\u5bfc\u81f4\u6d3e\u751f\u7c7b\u4e2d\u52a8\u6001\u5206\u914d\u7684\u8d44\u6e90\u6ca1\u6709\u88ab\u6b63\u786e\u91ca\u653e\uff0c\u8fdb\u800c\u5f15\u53d1\u5185\u5b58\u6cc4\u6f0f\u7b49\u95ee\u9898\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/51242.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-08-10T11:39:38+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/08\/20250810113934-689884f689bc0.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/51242.html","url":"https:\/\/www.wsisp.com\/helps\/51242.html","name":"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898-1 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-08-10T11:39:38+00:00","dateModified":"2025-08-10T11:39:38+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/51242.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/51242.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/51242.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u5d4c\u5165\u5f0f\u8f6f\u4ef6\u5f00\u53d1\u5de5\u7a0b\u5e08\u9762\u8bd5\u95ee\u9898---1"}]},{"@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\/51242","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=51242"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/51242\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/51240"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=51242"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=51242"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=51242"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=51242"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}