{"id":40941,"date":"2025-05-30T12:26:51","date_gmt":"2025-05-30T04:26:51","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40941.html"},"modified":"2025-05-30T12:26:51","modified_gmt":"2025-05-30T04:26:51","slug":"%e7%a0%b4%e8%a7%a3c-c%e5%86%85%e5%ad%98%e5%88%86%e9%85%8d%e4%b8%8e%e7%ae%a1%e7%90%86%ef%bc%9a%e5%86%85%e5%ad%98%e5%af%b9%e8%b1%a1%e6%a8%a1%e5%9e%8b%e7%a1%ac%e6%a0%b8%e5%89%96%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40941.html","title":{"rendered":"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790"},"content":{"rendered":"<p style=\"text-align:center\"><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"252\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-683933858ea26.gif\" width=\"190\" \/><\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-68393385acea3.gif\" \/>\u00a0<\/p>\n<p>\u00a0<\/p>\n<p><span style=\"color:#fe2c24\">\u524d\u5f15&#xff1a;<\/span><span style=\"color:#a2e043\">C&#043;&#043;\u7684\u5185\u5b58\u7ba1\u7406\u662f\u7f16\u7a0b\u4e2d\u7684\u4e00\u628a\u300c\u53cc\u5203\u5251\u300d\u2014\u2014\u5b83\u8d4b\u4e88\u5f00\u53d1\u8005\u6781\u81f4\u7684\u6027\u80fd\u63a7\u5236\u6743&#xff0c;\u5374\u4e5f\u6697\u85cf\u5185\u5b58\u6cc4\u6f0f\u3001\u60ac\u5782\u6307\u9488\u3001\u788e\u7247\u5316\u7b49\u81f4\u547d\u9677\u9631\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u7684 new\/delete \u8bef\u7528&#xff0c;\u8fd8\u662f\u8d44\u6df1\u5de5\u7a0b\u5e08\u7684\u667a\u80fd\u6307\u9488\u5faa\u73af\u5f15\u7528\u95ee\u9898&#xff0c;\u5185\u5b58\u76f8\u5173\u7684\u7f3a\u9677\u5f80\u5f80\u6210\u4e3a\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u4e2d\u4e4b\u91cd&#xff01;\u672c\u6587\u4ece\u5e95\u5c42\u539f\u7406\u51fa\u53d1&#xff0c;\u76f4\u51fb\u5185\u5b58\u5206\u914d\u7684\u8fd0\u884c\u673a\u5236&#xff08;\u5982\u5806\u6808\u4ea4\u4e92\u3001\u6570\u636e\u5206\u914d\u7b56\u7565&#xff09;&#xff0c;\u7ed3\u5408\u73b0\u4ee3C&#043;&#043;\u7279\u6027&#xff0c;\u5256\u6790\u9ad8\u5e76\u53d1\u573a\u666f\u4e0b\u7684\u6027\u80fd\u4f18\u5316\u7b56\u7565~\u6b63\u6587\u5f00\u59cb&#xff01;<\/span><\/p>\n<p id=\"main-toc\">\u76ee\u5f55<\/p>\n<p id=\"C%5CC%2B%2B%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83-toc\" style=\"margin-left:40px\">C\\\\C&#043;&#043;\u5185\u5b58\u5206\u5e03<\/p>\n<p id=\"%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83%E6%B5%8B%E8%AF%95%C2%A0-toc\" style=\"margin-left:40px\">\u5185\u5b58\u5206\u5e03\u6d4b\u8bd5\u00a0<\/p>\n<p id=\"C%E8%AF%AD%E8%A8%80%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:40px\">C\u8bed\u8a00\u5185\u5b58\u7ba1\u7406<\/p>\n<p id=\"C%2B%2B%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86-toc\" style=\"margin-left:40px\">C&#043;&#043;\u5185\u5b58\u7ba1\u7406<\/p>\n<p id=\"%E4%BD%BF%E7%94%A8-toc\" style=\"margin-left:120px\">\u4f7f\u7528<\/p>\n<p id=\"%E4%BC%98%E5%8A%BF-toc\" style=\"margin-left:120px\">\u4f18\u52bf<\/p>\n<p id=\"malloc%E5%AF%B9%E4%BA%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:200px\">malloc\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7c7b\u578b<\/p>\n<p id=\"new%E5%AF%B9%E4%BA%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:200px\">new\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7c7b\u578b<\/p>\n<p id=\"operator%20new%E4%B8%8Eoperator%20delete%E5%87%BD%E6%95%B0-toc\" style=\"margin-left:40px\">operator new\u4e0eoperator delete\u51fd\u6570<\/p>\n<p id=\"%E4%BB%8B%E7%BB%8D-toc\" style=\"margin-left:120px\">\u4ecb\u7ecd<\/p>\n<p id=\"operator%20new%E7%9A%84%E5%BA%95%E5%B1%82%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:120px\">operator new\u7684\u5e95\u5c42\u5b9e\u73b0<\/p>\n<p id=\"operator%20delete%E7%9A%84%E5%BA%95%E5%B1%82%E5%AE%9E%E7%8E%B0-toc\" style=\"margin-left:120px\">operator delete\u7684\u5e95\u5c42\u5b9e\u73b0<\/p>\n<p id=\"%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:120px\">\u603b\u7ed3<\/p>\n<p id=\"new%E4%B8%8Edelete%E7%9A%84%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86-toc\" style=\"margin-left:40px\">new\u4e0edelete\u7684\u5b9e\u73b0\u539f\u7406<\/p>\n<p id=\"%E5%86%85%E7%BD%AE%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:120px\">\u5185\u7f6e\u7c7b\u578b<\/p>\n<p id=\"%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B-toc\" style=\"margin-left:120px\">\u81ea\u5b9a\u4e49\u7c7b\u578b<\/p>\n<p id=\"new%E7%9A%84%E5%8E%9F%E7%90%86-toc\" style=\"margin-left:200px\">new\u7684\u539f\u7406<\/p>\n<p id=\"delete%E7%9A%84%E5%8E%9F%E7%90%86-toc\" style=\"margin-left:200px\">delete\u7684\u539f\u7406<\/p>\n<p id=\"%E4%B8%BE%E4%BE%8B-toc\" style=\"margin-left:200px\">\u4e3e\u4f8b<\/p>\n<p id=\"new%5B%20%5D%E7%9A%84%E5%8E%9F%E7%90%86-toc\" style=\"margin-left:200px\">new[ ]\u7684\u539f\u7406<\/p>\n<p id=\"delete%5B%20%5D%E7%9A%84%E5%8E%9F%E7%90%86-toc\" style=\"margin-left:200px\">delete[ ]\u7684\u539f\u7406<\/p>\n<p id=\"%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E6%80%BB%E7%BB%93-toc\" style=\"margin-left:40px\">\u5e38\u89c1\u9762\u8bd5\u9898\u603b\u7ed3<\/p>\n<p id=\"malloc%2Ffree%E4%B8%8Enew%2Fdelete%E5%8C%BA%E5%88%AB-toc\" style=\"margin-left:120px\">malloc\/free\u4e0enew\/delete\u533a\u522b<\/p>\n<p id=\"%E5%85%B1%E5%90%8C%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:200px\">\u5171\u540c\u7279\u70b9<\/p>\n<p id=\"%E7%9B%B4%E6%8E%A5%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:200px\">\u76f4\u63a5\u7279\u70b9<\/p>\n<p id=\"%E5%BA%95%E5%B1%82%E7%89%B9%E7%82%B9-toc\" style=\"margin-left:200px\">\u5e95\u5c42\u7279\u70b9<\/p>\n<p id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F-toc\" style=\"margin-left:120px\">\u5185\u5b58\u6cc4\u6f0f<\/p>\n<p id=\"%E4%BB%80%E4%B9%88%E6%98%AF%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F-toc\" style=\"margin-left:200px\">\u4ec0\u4e48\u662f\u5185\u5b58\u6cc4\u6f0f<\/p>\n<p id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%E5%8D%B1%E5%AE%B3-toc\" style=\"margin-left:200px\">\u5185\u5b58\u6cc4\u6f0f\u5371\u5bb3<\/p>\n<p id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%E5%88%86%E7%B1%BB-toc\" style=\"margin-left:200px\">\u5185\u5b58\u6cc4\u6f0f\u5206\u7c7b<\/p>\n<p id=\"%E5%A6%82%E4%BD%95%E6%A3%80%E6%9F%A5%2F%E9%81%BF%E5%85%8D%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F-toc\" style=\"margin-left:200px\">\u5982\u4f55\u68c0\u67e5\/\u907f\u514d\u5185\u5b58\u6cc4\u6f0f<\/p>\n<hr id=\"hr-toc\" \/>\n<h3 id=\"C%5CC%2B%2B%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83\" style=\"background-color:transparent\">C\\\\C&#043;&#043;\u5185\u5b58\u5206\u5e03<\/h3>\n<p><span style=\"color:#38d8f0\">\u4e0b\u9762\u662fC\/C&#043;&#043;\u4e2d\u7a0b\u5e8f\u5185\u5b58\u533a\u57df\u5212\u5206\u56fe<\/span>&#xff0c;\u5c0f\u7f16\u5bf9\u5b83\u4eec\u7684\u5206\u914d\u8fdb\u884c\u89e3\u8bfb&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"684\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-68393385bcf0e.png\" width=\"945\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u5185\u6838\u7a7a\u95f4&#xff1a;<\/span>\u7528\u6237\u4ee3\u7801\u4e0d\u80fd\u8bfb\u5199&#xff0c;\u4e00\u822c\u7528\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u5185\u6838\u4f7f\u7528<\/p>\n<p><span style=\"color:#fe2c24\">\u6808&#xff1a;<\/span>\u5411\u4e0b\u589e\u957f&#xff0c;\u7528\u4e8e\u5b58\u50a8\u5c40\u90e8\u53d8\u91cf\u548c\u51fd\u6570\u8c03\u7528\u4fe1\u606f&#xff08;\u9002\u5408\u4e34\u65f6\u6570\u636e&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\">\u5185\u5b58\u6620\u5c04\u6bb5&#xff1a;<\/span>\u6587\u4ef6\u6620\u5c04\u3001\u52a8\u6001\u5e93\u3001\u533f\u540d\u6620\u5c04&#xff08;\u540e\u9762\u518d\u5b66&#xff0c;\u5f53\u524d\u4e0d\u6613\u638c\u63e1&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\">\u5806&#xff1a;<\/span>\u5411\u4e0a\u589e\u957f&#xff0c;\u7528\u4e8e\u52a8\u6001\u5185\u5b58\u5206\u914d&#xff08;\u63d0\u4f9b\u7075\u6d3b\u7684\u5185\u5b58\u5927\u5c0f&#xff0c;\u4f46\u7a7a\u95f4\u6709\u9650&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\">\u6570\u636e\u6bb5&#xff1a;<\/span>\u5b58\u50a8\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u6570\u636e&#xff08;\u6570\u636e\u9700\u8981\u957f\u671f\u5b58\u5728&#xff09;<\/p>\n<p><span style=\"color:#fe2c24\">\u4ee3\u7801\u6bb5&#xff1a;<\/span>\u5b58\u653e\u53ef\u6267\u884c\u4ee3\u7801\u548c\u53ea\u8bfb\u5e38\u91cf&#xff08;\u4fdd\u62a4\u4ee3\u7801\u548c\u5e38\u91cf\u4e0d\u88ab\u4fee\u6539&#xff09;<\/p>\n<p><span style=\"color:#a2e043\">\u6570\u636e\u5206\u914d\u89e3\u8bfb&#xff1a;<\/span><\/p>\n<p>&#xff08;1&#xff09;\u56fe\u4e2d\u7684\u5168\u5c40\u53d8\u91cf\u3001\u9759\u6001\u6570\u636e\u9700\u8981\u957f\u671f\u5b58\u5728&#xff0c;\u7a0b\u5e8f\u542f\u52a8\u65f6\u5206\u914d&#xff0c;\u7a0b\u5e8f\u7ed3\u675f\u65f6\u91ca\u653e<\/p>\n<p>&#xff08;2&#xff09; localVar\u3001num1[10]\u3001char2[ ]\u3001pChar3\u3001ptr1\u3001ptr2\u3001ptr3\u8fd9\u4e9b\u53d8\u91cf\u5728\u51fd\u6570\u8c03\u7528\u65f6\u5206\u914d&#xff0c;\u51fd \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6570\u7ed3\u675f\u65f6\u81ea\u52a8\u91ca\u653e&#xff0c;\u968f\u7740\u51fd\u6570\u5f00\u8f9f&#xff0c;\u56e0\u6b64\u5b58\u50a8\u5728\u6808\u533a<\/p>\n<p>&#xff08;3&#xff09;pChar3\u6307\u9488\u6307\u5411\u7684\u201cabcd\u201d\u5c5e\u4e8e\u5b57\u7b26\u4e32\u3001char2\u7684\u5b57\u7b26\u6570\u7ec4&#xff0c;\u5c5e\u4e8e\u53ea\u8bfb\u7c7b&#xff0c;\u56e0\u6b64\u5b58\u50a8\u5728\u4ee3\u7801\u6bb5<\/p>\n<p>&#xff08;4&#xff09;malloc\u3001realloc\u3001calloc\u5f00\u8f9f\u7684\u5185\u5b58\u7a7a\u95f4\u4e0d\u53d7\u51fd\u6570\u63a7\u5236&#xff0c;\u9700\u8981\u624b\u52a8\u91ca\u653e&#xff0c;\u56fa\u5728\u5806\u533a<\/p>\n<p><span style=\"color:#a2e043\">\u95ee&#xff1a;\u4e3a\u4ec0\u4e48\u6307\u9488\u3001\u4ee5\u53ca\u5bf9\u5e94\u540e\u9762\u7684\u6570\u636e\u9700\u8981\u5206\u5f00\u5b58\u50a8&#xff1f;<\/span>&#xff08;\u96f7\u533a&#xff1a;\u8bef\u4ee5\u4e3a\u6574\u884c\u8bed\u53e5\u5728\u540c\u4e00\u4e2a\u7a7a\u95f4&#xff09;<\/p>\n<p>&#xff08;1&#xff09;\u9996\u5148\u6307\u9488\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u53d8\u91cf&#xff08;\u6307\u9488\u53d8\u91cf&#xff09;&#xff0c;\u5b58\u50a8\u6307\u5411\u540e\u9762\u6570\u636e\u7684\u5730\u5740&#xff0c;\u5b83\u7684\u751f\u547d\u5468\u671f\u9075\u5faa\u5c40 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u90e8\u53d8\u91cf\u89c4\u5219&#xff0c;\u56fa\u5b58\u50a8\u5728\u6808\u533a<\/p>\n<p>&#xff08;2&#xff09;\u540c\u7406 num1\u3010\u3011\u662f\u4e00\u4e2a\u5c40\u90e8\u6570\u7ec4\u53d8\u91cf&#xff0c;\u5b83\u7684\u751f\u547d\u5468\u671f\u4e5f\u662f\u968f\u5f53\u524d\u51fd\u6570\u5f00\u8f9f\u91ca\u653e<\/p>\n<p>&#xff08;3&#xff09;\u800c\u5b57\u7b26\u6307\u9488\u6307\u5411\u7684\u5b57\u7b26\u4e32\u6570\u636e\u5185\u5bb9\u5c5e\u4e8e\u53ea\u8bfb\u9700\u8981&#xff0c;\u56fa\u5b58\u50a8\u5728\u4ee3\u7801\u6bb5\u66f4\u597d<\/p>\n<p><span style=\"color:#fe2c24\">\u603b\u7ed3&#xff1a;<\/span>\u901a\u8fc7\u9ad8\u6548\u7684\u5185\u5b58\u5206\u914d\u65b9\u5f0f&#xff0c;\u4e0d\u65ad\u63d0\u9ad8\u7a0b\u5e8f\u7684\u6027\u80fd\u548c\u5b89\u5168\u6027<\/p>\n<h3 id=\"%E5%86%85%E5%AD%98%E5%88%86%E5%B8%83%E6%B5%8B%E8%AF%95%C2%A0\" style=\"background-color:transparent\">\u5185\u5b58\u5206\u5e03\u6d4b\u8bd5\u00a0<\/h3>\n<p>(1)static int staticGlobalVar &#061; 1;<\/p>\n<p>int main()<br \/>\n{<br \/>\n(2)int globalVar &#061; 1;<br \/>\n    (3)static int staticVar &#061; 1;<br \/>\n(4)int localVar &#061; 1;<br \/>\n(5)int num1[10] &#061; { 1, 2, 3, 4 };<br \/>\n(6)char char2[] &#061; &#034;abcd&#034;;<br \/>\n(7)const char* pChar3 &#061; &#034;abcd&#034;;<br \/>\n(8)int* ptr1 &#061; (int*)malloc(sizeof(int) * 4);<br \/>\n(9)int* ptr2 &#061; (int*)calloc(4, sizeof(int));<br \/>\n(10)int* ptr3 &#061; (int*)realloc(ptr2, sizeof(int) * 4);<br \/>\n(11)free(ptr1);<br \/>\n(12)free(ptr3);<\/p>\n<p>return 0;<br \/>\n} <\/p>\n<p><span style=\"color:#a2e043\">A&#xff1a;\u6808 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 B&#xff1a;\u5806 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 C&#xff1a;\u6570\u636e\u6bb5&#xff08;\u9759\u6001\u533a&#xff09; \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0D&#xff1a;\u4ee3\u7801\u6bb5&#xff08;\u5e38\u91cf\u533a&#xff09;<\/span><\/p>\n<p>globalVar\u5728\u54ea\u2014\u2014A \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 staticGlobalVar\u5728\u54ea\u2014\u2014C<\/p>\n<p>staticVar\u5728\u54ea\u2014\u2014C \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 localVar\u5728\u54ea\u2014\u2014A<\/p>\n<p>num1 \u5728\u54ea\u2014\u2014A \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0char2\u5728\u54ea\u2014\u2014A<\/p>\n<p>*char2\u5728\u54ea\u2014\u2014D \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0pChar3\u5728\u54ea\u2014\u2014A<\/p>\n<p>*pChar3\u5728\u54ea\u2014\u2014D \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ptr1\u5728\u54ea\u2014\u2014A<\/p>\n<p>*ptr1\u5728\u54ea\u2014\u2014B<\/p>\n<h3 id=\"C%E8%AF%AD%E8%A8%80%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86\">C\u8bed\u8a00\u5185\u5b58\u7ba1\u7406<\/h3>\n<p>\u9996\u5148C\u8bed\u8a00\u662f\u901a\u8fc7\u56db\u4e2a\u51fd\u6570\u6765\u5b9e\u73b0\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u7684&#xff0c;\u5b83\u4eec\u7684\u4f5c\u7528\u5982\u4e0b&#xff1a;<\/p>\n<p><span style=\"color:#38d8f0\">malloc&#xff1a;<\/span>\u5206\u914d\u6307\u5b9a\u5b57\u8282\u6570\u672a\u521d\u59cb\u5316\u5185\u5b58\u5757<\/p>\n<p>int* ptr1 &#061; (int*)malloc(sizeof(int) * 4); <\/p>\n<p><span style=\"color:#38d8f0\">realloc&#xff1a;<\/span>\u8c03\u6574\u539f\u6765\u5f00\u8f9f\u7684\u7a7a\u95f4&#xff0c;\u53c2\u6570\u4e3a\u539f\u5730\u5740\u8d77\u59cb\u5730\u3001\u7406\u60f3\u603b\u7a7a\u95f4\u5927\u5c0f<\/p>\n<p>int* ptr3 &#061; (int*)realloc(ptr2, sizeof(int) * 4); <\/p>\n<p><span style=\"color:#38d8f0\">calloc&#xff1a;<\/span>\u5206\u914d\u6307\u5b9a\u6570\u91cf\u548c\u5927\u5c0f\u7684\u5185\u5b58\u5757&#xff0c;\u5e76\u521d\u59cb\u5316\u4e3a0<\/p>\n<p>int* ptr2 &#061; (int*)calloc(4, sizeof(int)); <\/p>\n<p><span style=\"color:#38d8f0\">\u00a0free&#xff1a;<\/span>\u91ca\u653emalloc\u3001calloc\u3001realloc\u5f00\u8f9f\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u9632\u6b62\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u53c2\u6570\u662f\u91ca\u653e\u524d\u7a7a\u95f4\u8d77\u59cb\u5730\u5740<\/p>\n<p>free(ptr1); <\/p>\n<h3 id=\"C%2B%2B%E5%86%85%E5%AD%98%E7%AE%A1%E7%90%86\" style=\"background-color:transparent\">C&#043;&#043;\u5185\u5b58\u7ba1\u7406<\/h3>\n<p>\u9996\u5148C&#043;&#043;\u517c\u5bb9C\u8bed\u8a00&#xff0c;C\u8bed\u8a00\u5185\u5b58\u7ba1\u7406\u65b9\u5f0f\u5728C&#043;&#043;\u4e2d\u53ef\u4ee5\u7ee7\u7eed\u4f7f\u7528&#xff0c;\u4f46\u6709\u4e9b\u5730\u65b9\u5c31\u65e0\u80fd\u4e3a\u529b&#xff0c;\u800c\u4e14\u4f7f\u7528\u8d77\u6765\u6bd4\u8f83\u9ebb\u70e6\u3002\u56e0\u6b64C&#043;&#043;\u53c8\u63d0\u51fa\u4e86\u81ea\u5df1\u7684\u5185\u5b58\u7ba1\u7406\u65b9\u5f0f&#xff1a;<\/p>\n<p>\u901a\u8fc7<span style=\"color:#fe2c24\">new<\/span>\u548c<span style=\"color:#fe2c24\">delete<\/span>\u64cd\u4f5c\u7b26\u8fdb\u884c\u52a8\u6001\u5185\u5b58\u7ba1\u7406&#xff08;\u8bb0\u4f4f\u662f\u64cd\u4f5c\u7b26&#xff0c;\u4e0d\u662f\u51fd\u6570\u54e6&#xff01;&#xff09;<\/p>\n<h5 id=\"%E4%BD%BF%E7%94%A8\" style=\"background-color:transparent\">\u4f7f\u7528<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"638\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-68393385f129c.png\" width=\"1111\" \/><\/p>\n<p>C&#043;&#043;\u5185\u5b58\u5f00\u8f9f\u5bf9\u6bd4C\u8bed\u8a00\u66f4\u52a0\u7b80\u6d01\u4e86&#xff0c;\u4e0d\u7528\u53bb\u7e41\u7410\u7684\u5224\u65ad&#xff0c;\u4f8b\u5982&#xff1a;<\/p>\n<p>\/\/\u7533\u8bf7\u4e00\u4e2aint\u7c7b\u578b\u5927\u5c0f\u7684\u7a7a\u95f4<br \/>\nint* ptr4 &#061; new int;<\/p>\n<p>\/\/\u7533\u8bf7\u4e00\u4e2aint\u7c7b\u578b\u5927\u5c0f\u7684\u7a7a\u95f4\u5e76\u521d\u59cb\u5316\u4e3a10<br \/>\nint* ptr5 &#061; new int(10);<\/p>\n<p>\/\/\u7533\u8bf7\u5341\u4e2aint\u7c7b\u578b\u5927\u5c0f\u7684\u7a7a\u95f4<br \/>\nint* ptr6 &#061; new int[10];<\/p>\n<p>\/\/\u91ca\u653e<br \/>\ndelete ptr4;<br \/>\ndelete ptr5;<br \/>\ndelete[] ptr6; <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"834\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042646-683933865a76d.png\" width=\"2184\" \/><\/p>\n<p>\u5916\u56f4\u7528<span style=\"color:#fe2c24\">try<\/span>\u6355\u83b7\u5f02\u5e38&#xff1a;<\/p>\n<p>try<br \/>\n{<br \/>\n    Stack* pc &#061; new Stack&#xff1b;<\/p>\n<p>}<br \/>\ncatch (const exception&amp; e)<br \/>\n{<br \/>\n  \/\/\u6355\u83b7\u4fe1\u606f\u53cd\u9988&#xff08;\u53ef\u4ee5\u662f\u6253\u5370&#xff09;<br \/>\n} <\/p>\n<p><span style=\"color:#fe2c24\">\u6ce8\u610f&#xff1a;<\/span>\u5f00\u8f9f\u91ca\u653e\u9700\u8981\u914d\u5957&#xff08;\u5f00\u8f9f&#043;\u6355\u83b7&#xff09;\u4f7f\u7528&#xff0c;\u5982\u679c\u4e0d\u52a0\u6355\u83b7&#xff0c;\u7a0b\u5e8f\u4f1a\u76f4\u63a5\u5d29\u6e83&#xff0c;\u5426\u5219\u5bb9\u6613\u51fa\u95ee\u9898<\/p>\n<p>\u4f8b\u5982&#xff1a;\u5355\u4e2a\u7a7a\u95f4\u7533\u8bf7\u7528\u5355\u4e2a\u7684\u5f62\u5f0f\u91ca\u653e&#xff1b;\u5982\u679c\u662fnew\u3010\u3011\u7c7b\u578b\u7684\u7533\u8bf7&#xff0c;\u9700\u8981\u7528delete\u3010\u3011\u91ca\u653e<\/p>\n<h5 id=\"%E4%BC%98%E5%8A%BF\">\u4f18\u52bf<\/h5>\n<p>malloc\u4e0efree\u00a0 \u00a0\u8f83\u4e8e\u00a0 \u00a0new\u4e0edelete \u7684\u6700\u5927\u533a\u522b\u662f<span style=\"color:#fe2c24\">\u81ea\u5b9a\u4e49\u7c7b\u578b<\/span>\u7684\u7533\u8bf7\u5f00\u8f9f<span style=\"color:#fe2c24\">&#xff08;\u5185\u7f6e\u7c7b\u578b\u51e0\u4e4e\u4e00\u81f4&#xff09;<\/span><\/p>\n<p>\u00a0<\/p>\n<h6 id=\"malloc%E5%AF%B9%E4%BA%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B\" style=\"background-color:transparent\">malloc\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7c7b\u578b<\/h6>\n<p>\u7b80\u5355\u7533\u8bf7\u4e00\u4e2a\u4e00\u5b9a\u5927\u5c0f\u7684\u7a7a\u95f4\u5c31\u53ef\u4ee5\u4e86&#xff0c;\u5bf9\u4e8e\u7a7a\u95f4\u9700\u8981\u5224\u65ad\u6709\u6548\u6027&#xff0c;\u5176\u5b83\u597d\u50cf\u4e5f\u6ca1\u54c8&#8230;&#8230;<\/p>\n<\/p>\n<h6 id=\"new%E5%AF%B9%E4%BA%8E%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B\">new\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7c7b\u578b<\/h6>\n<p>new\u5bf9\u4e8e\u81ea\u5b9a\u4e49\u7c7b\u578b\u53ef\u4ee5\u8c03\u7528<span style=\"color:#fe2c24\">\u6784\u9020\u51fd\u6570<\/span>&#xff0c;delete\u91ca\u653e\u5185\u5b58\u53ef\u4ee5\u8c03\u7528<span style=\"color:#fe2c24\">\u6790\u6784\u51fd\u6570<\/span><\/p>\n<p>\u4f8b\u5982&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1052\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042647-6839338770bb4.png\" width=\"1840\" \/><\/p>\n<p>\u6548\u679c\u5c55\u793a&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"697\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042648-683933882e03b.png\" width=\"1333\" \/>\u00a0<\/p>\n<h3 id=\"operator%20new%E4%B8%8Eoperator%20delete%E5%87%BD%E6%95%B0\">operator new\u4e0eoperator delete\u51fd\u6570<\/h3>\n<h5 id=\"%E4%BB%8B%E7%BB%8D\">\u4ecb\u7ecd<\/h5>\n<p><span style=\"color:#fe2c24\">new \u00a0<\/span>\u548c \u00a0<span style=\"color:#fe2c24\">delete<\/span>\u662f\u7528\u6237\u8fdb\u884c\u52a8\u6001\u5185\u5b58\u7533\u8bf7\u548c\u91ca\u653e\u7684\u64cd\u4f5c\u7b26&#xff0c;<span style=\"color:#fe2c24\">operator new<\/span> \u548c <span style=\"color:#fe2c24\">operator delete<\/span>\u662f\u7cfb\u7edf\u63d0\u4f9b\u7684 <span style=\"color:#fe2c24\">\u5168\u5c40\u51fd\u6570<\/span>&#xff0c;new\u5728\u5e95\u5c42\u8c03\u7528operator new\u5168\u5c40\u51fd\u6570\u6765\u7533\u8bf7\u7a7a\u95f4&#xff0c;delete\u5728\u5e95\u5c42\u901a\u8fc7operator delete\u5168\u5c40 \u51fd\u6570\u6765\u91ca\u653e\u7a7a\u95f4&#xff0c;\u4e0b\u9762\u7684\u5e95\u5c42\u5b9e\u73b0\u4e86\u89e3\u5373\u53ef&#xff0c;\u8fd9\u5bf9\u4e8e\u6211\u4eec\u638c\u63e1\u5185\u5b58\u5f00\u8f9f\u662f\u5f88\u6709\u7528\u7684&#xff01;<\/p>\n<h5 id=\"operator%20new%E7%9A%84%E5%BA%95%E5%B1%82%E5%AE%9E%E7%8E%B0\">operator new\u7684\u5e95\u5c42\u5b9e\u73b0<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"836\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042648-683933887990e.png\" width=\"1394\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230<span style=\"color:#fe2c24\">\u00a0operator new<\/span>\u00a0\u7684\u5e95\u5c42\u662f\u00a0<span style=\"color:#fe2c24\">malloc\u00a0<\/span>\u5b9e\u73b0\u7684&#xff0c;\u00a0\u5b83\u8f83\u4e8e<span style=\"color:#fe2c24\">\u00a0malloc<\/span>\u00a0\u5f88\u5927\u7684\u4e0d\u540c\u662f&#xff1a;<\/p>\n<p>\u5982\u679c\u5f00\u8f9f\u7a7a\u95f4\u5931\u8d25&#xff0c;\u90a3\u4e48\u5c31\u4f1a<span style=\"color:#fe2c24\">\u629b\u51fa\u5f02\u5e38<\/span>&#xff0c;\u800c\u00a0<span style=\"color:#fe2c24\">malloc<\/span>\u00a0\u5219\u4f1a<span style=\"color:#fe2c24\">\u8fd4\u56de\u7a7a\u5730\u5740<\/span><\/p>\n<h5 id=\"operator%20delete%E7%9A%84%E5%BA%95%E5%B1%82%E5%AE%9E%E7%8E%B0\">operator delete\u7684\u5e95\u5c42\u5b9e\u73b0<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"385\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042648-68393388d8181.png\" width=\"1390\" \/><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1029\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042649-68393389199fa.png\" width=\"1396\" \/><\/p>\n<p>\u53ef\u4ee5\u770b\u5230\u5c3d\u7ba1\u518d\u600e\u4e48\u53bb\u4fee\u9970&#xff0c;\u5b83\u7684\u5e95\u5c42\u8fd8\u662ffree\u51fd\u6570~\u00a0\u00a0<\/p>\n<h5 id=\"%E6%80%BB%E7%BB%93\">\u603b\u7ed3<\/h5>\n<p>\u901a\u8fc7\u4e0a\u8ff0\u4e24\u4e2a\u5168\u5c40\u51fd\u6570\u7684\u5b9e\u73b0\u6211\u4eec\u53ef\u4ee5\u770b\u5230&#xff1a;<\/p>\n<p><span style=\"color:#fe2c24\">operator new<\/span>\u5b9e\u9645\u4e0a\u4e5f\u662f\u901a\u8fc7<span style=\"color:#fe2c24\">malloc<\/span>\u51fd\u6570\u6765\u5b9e\u73b0&#xff0c;\u53ea\u662f\u4e8c\u8005\u5728\u7a7a\u95f4\u201c\u62a5\u9519\u201d\u4e0a\u6709\u4e86\u660e\u663e\u533a\u522b<\/p>\n<p><span style=\"color:#fe2c24\">operator delete<\/span>\u5b9e\u9645\u4e0a\u4e5f\u662f\u901a\u8fc7<span style=\"color:#fe2c24\">free<\/span>\u51fd\u6570\u6765\u5b9e\u73b0<\/p>\n<h3 id=\"new%E4%B8%8Edelete%E7%9A%84%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86\">new\u4e0edelete\u7684\u5b9e\u73b0\u539f\u7406<\/h3>\n<h5 id=\"%E5%86%85%E7%BD%AE%E7%B1%BB%E5%9E%8B\">\u5185\u7f6e\u7c7b\u578b<\/h5>\n<p>\u5bf9\u4e8e int\u3001char\u3001double\u3001long&#8230;&#8230;..\u8fd9\u4e9b\u5185\u7f6e\u7c7b\u578b<\/p>\n<p>\u5982\u679c\u7533\u8bf7\u7684\u5185\u7f6e\u7c7b\u578b\u7684\u7a7a\u95f4&#xff0c;new\u4e0emalloc\u57fa\u672c\u7c7b\u4f3c&#xff0c;\u4e8c\u8005\u4e0d\u540c\u5730\u65b9\u5728\u4e8e&#xff1a;<\/p>\n<p><span style=\"color:#38d8f0\">new\u4e0edelete\u7533\u8bf7\/\u91ca\u653e\u7684\u662f\u5355\u4e2a\u5143\u7d20\u7684\u7a7a\u95f4&#xff0c;new[ ]\u4e0edelete[ ]\u7533\u8bf7\u7684\u662f\u8fde\u7eed\u5730\u5740\u7684\u7a7a\u95f4<\/span><\/p>\n<p><span style=\"color:#38d8f0\">\u800cnew\u7533\u8bf7\u5931\u8d25\u4f1a\u629b\u51fa\u5f02\u5e38&#xff0c;malloc\u5f00\u8f9f\u5931\u8d25\u4f1a\u8fd4\u56de\u7a7a&#xff08;\u65e0\u6548\u5730\u5740&#xff09;<\/span><\/p>\n<h5 id=\"%E8%87%AA%E5%AE%9A%E4%B9%89%E7%B1%BB%E5%9E%8B\">\u81ea\u5b9a\u4e49\u7c7b\u578b<\/h5>\n<h6 id=\"new%E7%9A%84%E5%8E%9F%E7%90%86\">new\u7684\u539f\u7406<\/h6>\n<p>&#xff08;1&#xff09;\u5148\u8c03\u7528operator new\u51fd\u6570\u7533\u8bf7\u7a7a\u95f4<\/p>\n<p>&#xff08;2&#xff09;\u5728\u7533\u8bf7\u7684\u7a7a\u95f4\u4e0a\u6267\u884c\u6784\u9020\u51fd\u6570&#xff0c;\u5b8c\u6210\u5bf9\u8c61\u7684\u521b\u5efa<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"297\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042649-683933898a700.png\" width=\"1194\" \/><\/p>\n<h6 id=\"delete%E7%9A%84%E5%8E%9F%E7%90%86\">delete\u7684\u539f\u7406<\/h6>\n<p>&#xff08;1&#xff09;\u8c03\u7528\u6790\u6784\u51fd\u6570&#xff0c;\u5b8c\u6210\u5bf9\u8c61\u4e2d\u8d44\u6e90\u7684\u6e05\u7406\u5de5\u4f5c<\/p>\n<p>&#xff08;2&#xff09;\u8c03\u7528operator delete\u51fd\u6570&#xff0c;\u5b8c\u6210\u5bf9\u7a7a\u95f4\u7684\u91ca\u653e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"360\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042649-68393389b6289.png\" width=\"1167\" \/><\/p>\n<h6 id=\"%E4%B8%BE%E4%BE%8B\">\u4e3e\u4f8b<\/h6>\n<p><span style=\"color:#a2e043\">\u7533\u8bf7\u4e00\u4e2a\u5728\u5806\u4e0a\u7684\u6808\u5bf9\u8c61<\/span><\/p>\n<p>\u8fd9\u91cc\u7684\u9700\u6c42\u5b8c\u7f8e\u4e0e\u6211\u4eec\u7684new\u5f00\u8f9f\u5339\u914d<\/p>\n<p>&#xff08;1&#xff09;\u5148\u8c03\u7528operator new\u51fd\u6570\u5728\u5806\u4e0a\u5f00\u8f9f\u5185\u5b58<\/p>\n<p>&#xff08;2&#xff09;\u518d\u8c03\u7528\u6784\u9020\u51fd\u6570\u5728\u6808\u4e0a\u5f00\u8f9f\u5bf9\u8c61<\/p>\n<p>Stack* pc &#061; new Stack&#xff1b; <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1074\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042649-68393389eac4b.png\" width=\"1593\" \/><\/p>\n<h6 id=\"new%5B%20%5D%E7%9A%84%E5%8E%9F%E7%90%86\">new[ ]\u7684\u539f\u7406<\/h6>\n<p>\u5bf9\u4e8e\u6709\u591a\u4e2a\u6570\u636e\u7684\u7533\u8bf7&#xff1a;<\/p>\n<p>&#xff08;1&#xff09;\u8c03\u7528N\u6b21operator new\u51fd\u6570\u5b8c\u6210\u7a7a\u95f4\u5f00\u8f9f<\/p>\n<p>&#xff08;2&#xff09;\u518d\u8c03\u7528N\u6b21\u6784\u9020\u51fd\u6570\u6267\u884c\u6784\u9020<\/p>\n<h6 id=\"delete%5B%20%5D%E7%9A%84%E5%8E%9F%E7%90%86\">delete[ ]\u7684\u539f\u7406<\/h6>\n<p>&#xff08;1&#xff09;\u8c03\u7528N\u6b21\u6790\u6784\u51fd\u6570\u5b8c\u6210\u8d44\u6e90\u7684\u6e05\u7406<\/p>\n<p>&#xff08;2&#xff09;\u8c03\u7528N\u6b21operator delete\u51fd\u6570\u5b8c\u6210\u7a7a\u95f4\u91ca\u653e<\/p>\n<h3 id=\"%E5%B8%B8%E8%A7%81%E9%9D%A2%E8%AF%95%E9%A2%98%E6%80%BB%E7%BB%93\">\u5e38\u89c1\u9762\u8bd5\u9898\u603b\u7ed3<\/h3>\n<h5 id=\"malloc%2Ffree%E4%B8%8Enew%2Fdelete%E5%8C%BA%E5%88%AB\" style=\"background-color:transparent\">malloc\/free\u4e0enew\/delete\u533a\u522b<\/h5>\n<h6 id=\"%E5%85%B1%E5%90%8C%E7%89%B9%E7%82%B9\">\u5171\u540c\u7279\u70b9<\/h6>\n<p>\u90fd\u9700\u8981\u624b\u52a8\u5f00\u8f9f\u3001\u624b\u52a8\u91ca\u653e<\/p>\n<h6 id=\"%E7%9B%B4%E6%8E%A5%E7%89%B9%E7%82%B9\">\u76f4\u63a5\u7279\u70b9<\/h6>\n<p>&#xff08;1&#xff09;malloc\u548cfree\u662f\u51fd\u6570&#xff0c;new\u548cdelete\u662f\u64cd\u4f5c\u7b26&#xff08;\u5173\u952e\u5b57&#xff09;<\/p>\n<p>&#xff08;2&#xff09;malloc\u5f00\u8f9f\u9700\u8981\u6307\u5b9a\u7a7a\u95f4\u5927\u5c0f&#xff0c;new\u5f00\u8f9f\u53ea\u9700\u8981\u7c7b\u578b&#xff08;\u591a\u4e2a\u7a7a\u95f4\u9700\u8981\u6307\u5b9a\u4e2a\u6570&#xff09;<\/p>\n<p>&#xff08;3&#xff09;malloc\u5f00\u8f9f\u4e0d\u80fd\u521d\u59cb\u5316&#xff0c;new\u5f00\u8f9f\u53ef\u4ee5<\/p>\n<p>&#xff08;4&#xff09;malloc\u5f00\u8f9f\u7a7a\u95f4\u9700\u8981\u5f3a\u8f6c\u7c7b\u578b&#xff0c;new\u5f00\u8f9f\u53ea\u9700\u8981\u6307\u660e\u7c7b\u578b\u5373\u53ef<\/p>\n<p>&#xff08;5&#xff09;malloc\u7533\u8bf7\u5931\u8d25\u8fd4\u56de\u7684\u662fNULL&#xff0c;new\u5f00\u8f9f\u5931\u8d25\u4f1a\u6355\u83b7\u5f02\u5e38<\/p>\n<h6 id=\"%E5%BA%95%E5%B1%82%E7%89%B9%E7%82%B9\">\u5e95\u5c42\u7279\u70b9<\/h6>\n<p>malloc\u5f00\u8f9f\u53ea\u662f\u7b80\u5355\u7684\u7533\u8bf7\u5bf9\u5e94\u5927\u5c0f\u7684\u7a7a\u95f4&#xff0c;free\u4e5f\u662f\u76f4\u63a5\u91ca\u653e\u7a7a\u95f4<\/p>\n<p>new\u5f00\u8f9f\u4f1a\u8c03\u7528operator new\u3001\u6784\u9020\u51fd\u6570&#xff08;\u5148\u5f00\u8f9f\u7a7a\u95f4&#xff0c;\u518d\u8fdb\u884c\u6784\u9020&#xff09;<\/p>\n<p>delete\u91ca\u653e\u4f1a\u8c03\u7528operator delete\u3001\u6790\u6784\u51fd\u6570&#xff08;\u5148\u6e05\u7406\u8d44\u6e90&#xff0c;\u518d\u91ca\u653e\u7a7a\u95f4&#xff09;<\/p>\n<h5 id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F\">\u5185\u5b58\u6cc4\u6f0f<\/h5>\n<h6 id=\"%E4%BB%80%E4%B9%88%E6%98%AF%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F\"><span style=\"color:#a2e043\">\u4ec0\u4e48\u662f\u5185\u5b58\u6cc4\u6f0f<\/span><\/h6>\n<p>\u5185\u5b58\u6cc4\u6f0f\u6307\u56e0\u4e3a\u758f\u5ffd\u6216\u9519\u8bef\u9020\u6210\u7a0b\u5e8f\u672a\u80fd\u91ca\u653e\u5df2\u7ecf\u4e0d\u518d\u4f7f\u7528\u7684\u5185\u5b58\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u5185\u5b58\u6cc4\u6f0f\u5e76\u4e0d\u662f\u6307\u5185\u5b58\u5728\u7269\u7406\u4e0a\u7684\u6d88\u5931&#xff0c;\u800c\u662f\u5e94\u7528\u7a0b\u5e8f\u5206\u914d\u67d0\u6bb5\u5185\u5b58\u540e&#xff0c;\u56e0\u4e3a\u8bbe\u8ba1\u9519\u8bef&#xff0c;\u5931\u53bb\u4e86\u5bf9\u8be5\u6bb5\u5185\u5b58\u7684\u63a7\u5236&#xff0c;\u56e0\u800c\u9020\u6210\u4e86\u5185\u5b58\u7684\u6d6a\u8d39<\/p>\n<h6 id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%E5%8D%B1%E5%AE%B3\"><span style=\"color:#a2e043\">\u5185\u5b58\u6cc4\u6f0f\u5371\u5bb3<\/span><\/h6>\n<p>\u957f\u671f\u8fd0\u884c\u7684\u7a0b\u5e8f\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u5f71\u54cd\u5f88\u5927&#xff0c;\u5982\u64cd\u4f5c\u7cfb\u7edf\u3001\u540e\u53f0\u670d\u52a1\u7b49\u7b49&#xff0c;\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\u4f1a\u5bfc\u81f4\u54cd\u5e94\u8d8a\u6765\u8d8a\u6162&#xff0c;\u6700\u7ec8\u5361\u6b7b<\/p>\n<h6 id=\"%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F%E5%88%86%E7%B1%BB\">\u5185\u5b58\u6cc4\u6f0f\u5206\u7c7b<\/h6>\n<p><span style=\"color:#38d8f0\">\u5806\u5185\u5b58\u6cc4\u6f0f&#xff1a;<\/span><\/p>\n<p>\u5806\u5185\u5b58\u6307\u7684\u662f\u7a0b\u5e8f\u6267\u884c\u4e2d\u4f9d\u636e\u987b\u8981\u5206\u914d\u901a\u8fc7malloc \/ calloc \/ realloc \/ new\u7b49\u4ece\u5806\u4e2d\u5206\u914d\u7684\u4e00\u5757\u5185\u5b58&#xff0c; \u7528\u5b8c\u540e\u5fc5\u987b\u901a\u8fc7\u8c03\u7528\u76f8\u5e94\u7684 free\u6216\u8005delete \u5220\u6389\u3002\u5047\u8bbe\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u9519\u8bef\u5bfc\u81f4\u8fd9\u90e8\u5206\u5185\u5b58\u6ca1\u6709\u88ab\u91ca\u653e&#xff0c;\u90a3 \u4e48\u4ee5\u540e\u8fd9\u90e8\u5206\u7a7a\u95f4\u5c06\u65e0\u6cd5\u518d\u88ab\u4f7f\u7528&#xff0c;\u5c31\u4f1a\u4ea7\u751fHeap Leak<\/p>\n<p><span style=\"color:#38d8f0\">\u7cfb\u7edf\u8d44\u6e90\u6cc4\u6f0f&#xff1a;<\/span><\/p>\n<p>\u6307\u7a0b\u5e8f\u4f7f\u7528\u7cfb\u7edf\u5206\u914d\u7684\u8d44\u6e90&#xff0c;\u6bd4\u65b9\u5957\u63a5\u5b57\u3001\u6587\u4ef6\u63cf\u8ff0\u7b26\u3001\u7ba1\u9053\u7b49\u6ca1\u6709\u4f7f\u7528\u5bf9\u5e94\u7684\u51fd\u6570\u91ca\u653e\u6389&#xff0c;\u5bfc\u81f4\u7cfb\u7edf \u8d44\u6e90\u7684\u6d6a\u8d39&#xff0c;\u4e25\u91cd\u53ef\u5bfc\u81f4\u7cfb\u7edf\u6548\u80fd\u51cf\u5c11&#xff0c;\u7cfb\u7edf\u6267\u884c\u4e0d\u7a33\u5b9a<\/p>\n<h6 id=\"%E5%A6%82%E4%BD%95%E6%A3%80%E6%9F%A5%2F%E9%81%BF%E5%85%8D%E5%86%85%E5%AD%98%E6%B3%84%E6%BC%8F\">\u5982\u4f55\u68c0\u67e5\/\u907f\u514d\u5185\u5b58\u6cc4\u6f0f<\/h6>\n<p>&#xff08;1&#xff09;\u9996\u5148\u662f\u68c0\u67e5\u5185\u5b58\u6cc4\u6f0f&#xff0c;\u8fd9\u91cc\u5148\u53ea\u4e86\u89e3&#xff0c;\u540e\u9762\u4f1a\u8fdb\u884c\u5b66\u4e60<\/p>\n<p>&#xff08;2&#xff09;\u826f\u597d\u7684\u64cd\u4f5c\u4e60\u60ef\u3001\u667a\u80fd\u6307\u9488&#xff08;\u540e\u9762\u5b66\u4e60&#xff09;\u3001\u67d0\u4e9b\u516c\u53f8\u4f1a\u81ea\u5e26\u5185\u5b58\u6cc4\u6f0f\u68c0\u6d4b\u529f\u80fd\u3001\u5185\u5b58\u6cc4\u6f0f\u68c0\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6d4b\u5de5\u5177&#xff08;\u6602\u8d35&#xff09;<\/p>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042650-6839338aad593.gif\" \/><\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u00a0<span style=\"color:#a2e043\">\u00a0\u00a0 \u00a0\u3010\u96fe\u975e\u96fe\u3011\u671f\u5f85\u4e0e\u4f60\u7684\u4e0b\u6b21\u76f8\u9047&#xff01;\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e103\u6b21\uff0c\u6536\u85cf104\u6b21\u3002C++\u7684\u5185\u5b58\u7ba1\u7406\u662f\u7f16\u7a0b\u4e2d\u7684\u4e00\u628a\u300c\u53cc\u5203\u5251\u300d\u2014\u2014\u5b83\u8d4b\u4e88\u5f00\u53d1\u8005\u6781\u81f4\u7684\u6027\u80fd\u63a7\u5236\u6743\uff0c\u5374\u4e5f\u6697\u85cf\u5185\u5b58\u6cc4\u6f0f\u3001\u60ac\u5782\u6307\u9488\u3001\u788e\u7247\u5316\u7b49\u81f4\u547d\u9677\u9631\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u7684 new\/delete \u8bef\u7528\uff0c\u8fd8\u662f\u8d44\u6df1\u5de5\u7a0b\u5e08\u7684\u667a\u80fd\u6307\u9488\u5faa\u73af\u5f15\u7528\u95ee\u9898\uff0c\u5185\u5b58\u76f8\u5173\u7684\u7f3a\u9677\u5f80\u5f80\u6210\u4e3a\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u4e2d\u4e4b\u91cd\uff0c\u4e5f\u662f\u5c0f\u767d\u5b66\u4e60\u5185\u5b58\u5206\u914d\u7ba1\u7406\u7684\u4e0d\u4e8c\u4e4b\u9009\uff01<\/p>\n","protected":false},"author":2,"featured_media":40927,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,3745,3754,190,3755],"topic":[],"class_list":{"0":"post-40941","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","6":"hentry","7":"category-server","8":"tag-c","10":"tag-3754","11":"tag-190","12":"tag-3755"},"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \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\/40941.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e103\u6b21\uff0c\u6536\u85cf104\u6b21\u3002C++\u7684\u5185\u5b58\u7ba1\u7406\u662f\u7f16\u7a0b\u4e2d\u7684\u4e00\u628a\u300c\u53cc\u5203\u5251\u300d\u2014\u2014\u5b83\u8d4b\u4e88\u5f00\u53d1\u8005\u6781\u81f4\u7684\u6027\u80fd\u63a7\u5236\u6743\uff0c\u5374\u4e5f\u6697\u85cf\u5185\u5b58\u6cc4\u6f0f\u3001\u60ac\u5782\u6307\u9488\u3001\u788e\u7247\u5316\u7b49\u81f4\u547d\u9677\u9631\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u7684 new\/delete \u8bef\u7528\uff0c\u8fd8\u662f\u8d44\u6df1\u5de5\u7a0b\u5e08\u7684\u667a\u80fd\u6307\u9488\u5faa\u73af\u5f15\u7528\u95ee\u9898\uff0c\u5185\u5b58\u76f8\u5173\u7684\u7f3a\u9677\u5f80\u5f80\u6210\u4e3a\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u4e2d\u4e4b\u91cd\uff0c\u4e5f\u662f\u5c0f\u767d\u5b66\u4e60\u5185\u5b58\u5206\u914d\u7ba1\u7406\u7684\u4e0d\u4e8c\u4e4b\u9009\uff01\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40941.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-30T04:26:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-683933858ea26.gif\" \/>\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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40941.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40941.html\",\"name\":\"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-30T04:26:51+00:00\",\"dateModified\":\"2025-05-30T04:26:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40941.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40941.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40941.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790\"}]},{\"@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":"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \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\/40941.html","og_locale":"zh_CN","og_type":"article","og_title":"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb8.4k\u6b21\uff0c\u70b9\u8d5e103\u6b21\uff0c\u6536\u85cf104\u6b21\u3002C++\u7684\u5185\u5b58\u7ba1\u7406\u662f\u7f16\u7a0b\u4e2d\u7684\u4e00\u628a\u300c\u53cc\u5203\u5251\u300d\u2014\u2014\u5b83\u8d4b\u4e88\u5f00\u53d1\u8005\u6781\u81f4\u7684\u6027\u80fd\u63a7\u5236\u6743\uff0c\u5374\u4e5f\u6697\u85cf\u5185\u5b58\u6cc4\u6f0f\u3001\u60ac\u5782\u6307\u9488\u3001\u788e\u7247\u5316\u7b49\u81f4\u547d\u9677\u9631\u3002\u65e0\u8bba\u662f\u521d\u5b66\u8005\u7684 new\/delete \u8bef\u7528\uff0c\u8fd8\u662f\u8d44\u6df1\u5de5\u7a0b\u5e08\u7684\u667a\u80fd\u6307\u9488\u5faa\u73af\u5f15\u7528\u95ee\u9898\uff0c\u5185\u5b58\u76f8\u5173\u7684\u7f3a\u9677\u5f80\u5f80\u6210\u4e3a\u4ee3\u7801\u8d28\u91cf\u7684\u91cd\u4e2d\u4e4b\u91cd\uff0c\u4e5f\u662f\u5c0f\u767d\u5b66\u4e60\u5185\u5b58\u5206\u914d\u7ba1\u7406\u7684\u4e0d\u4e8c\u4e4b\u9009\uff01","og_url":"https:\/\/www.wsisp.com\/helps\/40941.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-30T04:26:51+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2025\/05\/20250530042645-683933858ea26.gif"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/40941.html","url":"https:\/\/www.wsisp.com\/helps\/40941.html","name":"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-30T04:26:51+00:00","dateModified":"2025-05-30T04:26:51+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40941.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40941.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40941.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u7834\u89e3C\/C++\u5185\u5b58\u5206\u914d\u4e0e\u7ba1\u7406\uff1a\u5185\u5b58\u5bf9\u8c61\u6a21\u578b\u786c\u6838\u5256\u6790"}]},{"@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\/40941","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=40941"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40941\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/40927"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40941"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40941"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40941"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40941"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}