{"id":95149,"date":"2026-08-16T10:49:18","date_gmt":"2026-08-16T02:49:18","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/95149.html"},"modified":"2026-08-16T10:49:18","modified_gmt":"2026-08-16T02:49:18","slug":"c%e8%af%ad%e8%a8%80%e6%8c%87%e9%92%88%e8%bf%9b%e9%98%b6%e8%a1%a5%e5%85%856%ef%bc%9a%e5%8a%a8%e6%80%81%e5%86%85%e5%ad%98%e7%ae%a1%e7%90%86%e3%80%81mem%e7%b3%bb%e5%88%97%e5%86%85%e5%ad%98%e5%87%bd","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/95149.html","title":{"rendered":"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260816024912-6a8125286f807.jpg\" \/><\/p>\n<p><span style=\"color:#fe2c24\">\u4e2a\u4eba\u4e3b\u9875&#xff1a;GeekZHR\u00a0 \u00a0\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u4e92\u4e09<\/span><\/p>\n<p><span style=\"color:#956fe7\">25\u7ea7\u673a\u5668\u4eba\u5de5\u7a0bN\u975e\u672c\u79d1\u751f\u5728\u8bfb&#xff0c;\u81ea\u5b66C\/C&#043;&#043;&#xff0c;\u5d4c\u5165\u5f0f\u8f6f\u786c\u4ef6\u7b49\u7b49ing<\/span><\/p>\n<p><span style=\"color:#956fe7\">\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8bc4\u8bba\u533a\u4e92\u52a8\u4ea4\u6d41<\/span><\/p>\n<p class=\"img-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260816024917-6a81252d0d295.gif\" \/><\/p>\n<p>\u5199\u5728\u524d\u9762&#xff1a;\u524d\u4e94\u8bb2&#034;\u7559\u7684\u5c3e\u5df4&#034;&#xff0c;\u90fd\u5728\u8fd9\u4e00\u7bc7\u8865\u4e0a<\/p>\n<p>\u524d\u4e94\u8bb2&#xff0c;\u6211\u4eec\u4e00\u8def\u4ece&#034;\u5730\u5740 &#061;&#061; \u6307\u9488\u53d8\u91cf&#034;&#xff0c;\u8bb2\u5230&#034;\u6570\u7ec4\u540d &#061;&#061; \u9996\u5143\u7d20\u5730\u5740&#034;&#xff0c;\u518d\u5230&#034;\u51fd\u6570\u6307\u9488\u3001\u56de\u8c03\u51fd\u6570\u3001\u7b14\u8bd5\u9898&#034;&#xff0c;\u628a\u6307\u9488\u7684\u5e38\u89c4\u5185\u5bb9\u57fa\u672c\u8d70\u5b8c\u4e86\u3002\u4f46\u6709\u51e0\u4e2a\u5730\u65b9&#xff0c;\u7cfb\u5217\u91cc\u5176\u5b9e\u662f\u7559\u4e86\u4f0f\u7b14\u3001\u6ca1\u6765\u5f97\u53ca\u5c55\u5f00\u7684\u2014\u2014\u6bd4\u5982\u6307\u9488(4)\u91cc\u63d0\u8fc7\u4e00\u53e5&#034;void* \u5728\u5185\u5b58\u51fd\u6570\u91cc\u600e\u4e48\u7528&#034;&#xff0c;\u6307\u9488(3)\u91cc\u4e5f\u63d0\u8fc7\u4e00\u53e5&#034;\u590d\u6742\u58f0\u660e\u7684\u53f3\u5de6\u6cd5\u5219\u600e\u4e48\u8bfb&#034;\u3002\u66f4\u91cd\u8981\u7684\u662f&#xff0c;\u8fd8\u6709\u4e00\u6574\u5757\u52a8\u6001\u5185\u5b58\u7ba1\u7406&#xff08;malloc\/free&#xff09;&#xff0c;\u524d\u4e94\u8bb2\u538b\u6839\u6ca1\u78b0&#xff0c;\u800c\u5b83\u6070\u6070\u662f\u9762\u8bd5\u548c\u771f\u5b9e\u9879\u76ee\u91cc\u6307\u9488\u6700&#034;\u8981\u547d&#034;\u7684\u5730\u65b9\u3002\u8fd9\u7bc7\u8865\u5145\u7bc7&#xff0c;\u6211\u5c31\u628a\u8fd9\u4e09\u5757\u76f2\u533a\u4e00\u6b21\u8865\u9f50&#xff1a;\u52a8\u6001\u5185\u5b58\u7ba1\u7406 \u2192 mem \u7cfb\u5217\u5185\u5b58\u51fd\u6570 \u2192 \u590d\u6742\u6307\u9488\u58f0\u660e&#xff0c;\u914d\u597d\u56fe&#xff0c;\u4e89\u53d6\u7ed9\u6307\u9488\u7cfb\u5217\u771f\u6b63\u753b\u4e0a\u53e5\u53f7\u3002<\/p>\n<hr \/>\n<h3>\u4e00\u3001\u52a8\u6001\u5185\u5b58\u7ba1\u7406&#xff08;\u6307\u9488 &#043; \u5806&#xff09;<\/h3>\n<h4>1.1 \u4e3a\u4ec0\u4e48\u9700\u8981\u52a8\u6001\u5185\u5b58&#xff1f;\u5148\u5206\u6e05&#034;\u4e09\u4e2a\u533a&#034;<\/h4>\n<p>\u5230\u76ee\u524d\u6211\u4eec\u5199\u8fc7\u7684\u53d8\u91cf&#xff0c;\u8981\u4e48\u662f\u5c40\u90e8\u53d8\u91cf&#xff08;\u51fd\u6570\u91cc\u5b9a\u4e49&#xff09;&#xff0c;\u8981\u4e48\u662f\u5168\u5c40\u53d8\u91cf\u3002\u5b83\u4eec\u90fd\u6709\u4e00\u4e2a\u5171\u540c\u70b9&#xff1a;\u5927\u5c0f\u5728\u7f16\u8bd1\u671f\u5c31\u786e\u5b9a\u4e86\u3002\u53ef\u771f\u5b9e\u9879\u76ee\u91cc&#xff0c;\u7ecf\u5e38\u6709&#034;\u6570\u7ec4\u591a\u5927&#xff0c;\u8981\u7b49\u7a0b\u5e8f\u8dd1\u8d77\u6765\u624d\u77e5\u9053&#034;\u7684\u573a\u666f\u2014\u2014\u6bd4\u5982\u8bfb\u4e00\u4e2a\u6587\u4ef6\u3001\u63a5\u6536\u7528\u6237\u8f93\u5165&#xff0c;\u4e8b\u5148\u6839\u672c\u4e0d\u77e5\u9053\u6709\u591a\u5c11\u6570\u636e\u3002<\/p>\n<p>\u5185\u5b58\u91cc\u5927\u81f4\u5206\u6210\u8fd9\u4e48\u51e0\u4e2a\u533a&#xff08;\u4e0d\u540c\u5e73\u53f0\u53eb\u6cd5\u7565\u6709\u5dee\u5f02&#xff0c;\u6293\u4f4f\u672c\u8d28\u5373\u53ef&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u6808\u533a&#xff08;stack&#xff09;&#xff1a;\u653e\u5c40\u90e8\u53d8\u91cf\u3001\u51fd\u6570\u53c2\u6570&#xff0c;\u7f16\u8bd1\u5668\u81ea\u52a8\u5206\u914d\u3001\u81ea\u52a8\u56de\u6536&#xff0c;\u7528\u5b8c\u5c31\u6ca1\u4e86&#xff1b;<\/li>\n<li>\u5806\u533a&#xff08;heap&#xff09;&#xff1a;\u653e\u52a8\u6001\u5185\u5b58&#xff0c;\u7531\u7a0b\u5e8f\u5458\u624b\u52a8 malloc \u7533\u8bf7\u3001free \u91ca\u653e&#xff0c;\u4e0d\u7528\u4e86\u5c31\u6cc4\u6f0f&#xff1b;<\/li>\n<li>\u9759\u6001\u533a&#xff08;static&#xff09;&#xff1a;\u653e\u5168\u5c40\u53d8\u91cf\u3001static \u4fee\u9970\u7684\u53d8\u91cf&#xff0c;\u7a0b\u5e8f\u8fd0\u884c\u671f\u95f4\u4e00\u76f4\u5b58\u5728\u3002<\/li>\n<\/ul>\n<p>&#x1f511; \u5173\u952e\u533a\u5206&#xff1a;\u6808\u4e0a\u7684\u4e1c\u897f&#034;\u81ea\u52a8\u7ba1&#034;&#xff0c;\u5806\u4e0a\u7684\u4e1c\u897f&#034;\u624b\u52a8\u7ba1&#034;\u3002\u52a8\u6001\u5185\u5b58\u5206\u914d&#xff0c;\u5c31\u662f\u5728\u5806\u533a\u4e0a\u624b\u52a8\u5f00\u8f9f\u4e00\u5757\u7a7a\u95f4&#xff0c;\u5927\u5c0f\u53ef\u4ee5\u5728\u8fd0\u884c\u65f6\u624d\u51b3\u5b9a\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"1035\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260816024917-6a81252d24036.png\" width=\"1485\" \/><\/p>\n<h4>1.2 malloc \u548c free<\/h4>\n<p>malloc \u5728\u5806\u4e0a\u7533\u8bf7\u4e00\u5757\u8fde\u7eed\u7a7a\u95f4&#xff0c;\u51fd\u6570\u539f\u578b&#xff1a;<\/p>\n<p>void* malloc(size_t size);   \/\/ \u53c2\u6570&#xff1a;\u8981\u7533\u8bf7\u7684\u5b57\u8282\u6570<\/p>\n<ul>\n<li>\u53c2\u6570\u662f\u5b57\u8282\u6570&#xff0c;\u4e0d\u662f\u5143\u7d20\u4e2a\u6570&#xff08;\u60f3\u5f00 10 \u4e2a int&#xff0c;\u5c31\u4f20 10 * sizeof(int)&#xff09;&#xff1b;<\/li>\n<li>\u8fd4\u56de\u503c\u662f\u8fd9\u5757\u7a7a\u95f4\u7684\u9996\u5730\u5740&#xff08;void*&#xff0c;\u6240\u4ee5\u80fd\u8d4b\u7ed9\u4efb\u610f\u6307\u9488\u7c7b\u578b&#xff09;&#xff1b;<\/li>\n<li>\u5206\u914d\u5931\u8d25\u8fd4\u56de NULL&#xff0c;\u6240\u4ee5\u7528\u4e4b\u524d\u4e00\u5b9a\u8981\u5224\u65ad\u3002<\/li>\n<\/ul>\n<p>free \u7528\u6765\u91ca\u653e malloc\/calloc\/realloc \u7533\u8bf7\u7684\u7a7a\u95f4&#xff1a;<\/p>\n<p>void free(void* ptr);   \/\/ \u91ca\u653e ptr \u6307\u5411\u7684\u52a8\u6001\u5185\u5b58<\/p>\n<p>\u770b\u4e00\u4e2a\u5b8c\u6574\u4f8b\u5b50\u2014\u2014\u7533\u8bf7 10 \u4e2a int&#xff0c;\u7528\u5b8c\u91ca\u653e&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;   \/\/ malloc\/free \u5728 stdlib.h \u91cc<\/p>\n<p>int main()<br \/>\n{<br \/>\n    int *p &#061; (int*)malloc(10 * sizeof(int));   \/\/ \u7533\u8bf7 10 \u4e2a int \u7684\u7a7a\u95f4<br \/>\n    if (p &#061;&#061; NULL)                              \/\/ \u5148\u5224\u65ad\u662f\u5426\u7533\u8bf7\u6210\u529f<br \/>\n    {<br \/>\n        perror(&#034;malloc&#034;);<br \/>\n        return 1;<br \/>\n    }<\/p>\n<p>    int i &#061; 0;<br \/>\n    for (i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        p[i] &#061; i &#043; 1;                           \/\/ \u5f53\u4f5c\u6570\u7ec4\u7528<\/p>\n<p>    for (i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        printf(&#034;%d &#034;, p[i]);<\/p>\n<p>    free(p);       \/\/ \u7528\u5b8c\u91ca\u653e<br \/>\n    p &#061; NULL;      \/\/ \u91ca\u653e\u540e\u7f6e NULL&#xff0c;\u9632\u6b62\u91ce\u6307\u9488<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u4e24\u4e2a\u5fc5\u987b\u8bb0\u4f4f\u7684\u8981\u70b9&#xff1a;<\/p>\n<li>malloc \u7528\u5b8c\u4e00\u5b9a\u8981 free&#xff0c;\u5426\u5219\u8fd9\u5757\u5185\u5b58\u4f1a\u4e00\u76f4\u5360\u7740&#xff0c;\u7a0b\u5e8f\u4e5f\u4e0d\u8fd8\u2014\u2014\u8fd9\u5c31\u662f\u5185\u5b58\u6cc4\u6f0f&#xff1b;<\/li>\n<li>free(p) \u4e4b\u540e\u8981\u628a p \u7f6e\u6210 NULL&#xff0c;\u5426\u5219 p \u8fd8\u7559\u7740\u90a3\u5757\u5df2\u91ca\u653e\u7684\u5730\u5740&#xff0c;\u6210\u4e86&#034;\u60ac\u5782\u6307\u9488&#034;&#xff0c;\u518d\u78b0\u5b83\u5c31\u5371\u9669\u3002<\/li>\n<p>&#x1f511; \u4e00\u53e5\u8bdd&#xff1a;malloc \u548c free \u5fc5\u987b\u6210\u5bf9\u51fa\u73b0\u3002\u7533\u8bf7\u4e86\u4e0d\u91ca\u653e\u662f&#034;\u5185\u5b58\u6cc4\u6f0f&#034;&#xff0c;\u91ca\u653e\u4e86\u4e0d\u7f6e NULL \u662f&#034;\u91ce\u6307\u9488&#034;\u3002<\/p>\n<\/p>\n<h4>1.3 calloc&#xff08;\u7533\u8bf7 &#043; \u81ea\u52a8\u6e05\u96f6&#xff09;<\/h4>\n<p>calloc \u4e5f\u662f\u7533\u8bf7\u52a8\u6001\u5185\u5b58&#xff0c;\u539f\u578b&#xff1a;<\/p>\n<p>void* calloc(size_t num, size_t size);   \/\/ num \u4e2a\u5143\u7d20&#xff0c;\u6bcf\u4e2a size \u5b57\u8282<\/p>\n<p>\u5b83\u548c malloc \u7684\u533a\u522b\u6709\u4e24\u5904&#xff1a;\u4e00\u662f\u53c2\u6570\u62c6\u6210\u4e86&#034;\u5143\u7d20\u4e2a\u6570 \u00d7 \u5355\u4e2a\u5927\u5c0f&#034;&#xff0c;\u4e8c\u662f\u7533\u8bf7\u51fa\u6765\u7684\u5185\u5b58\u4f1a\u88ab\u81ea\u52a8\u521d\u59cb\u5316\u4e3a 0\u3002<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    int *p &#061; (int*)calloc(10, sizeof(int));   \/\/ \u7b49\u4ef7\u4e8e 10 \u4e2a int&#xff0c;\u4e14\u5168\u88ab\u7f6e 0<br \/>\n    if (p &#061;&#061; NULL)<br \/>\n        return 1;<br \/>\n    \/\/ \u6b64\u65f6 p[0] ~ p[9] \u5168\u90fd\u662f 0&#xff0c;\u4e0d\u7528\u81ea\u5df1\u518d\u6e05\u96f6<br \/>\n    free(p);<br \/>\n    p &#061; NULL;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>&#x1f511; \u9009\u62e9&#xff1a;\u9700\u8981&#034;\u7533\u8bf7\u5b8c\u5c31\u662f 0&#034;\u7684\u573a\u666f&#xff08;\u6bd4\u5982\u8ba1\u6570\u5668\u3001\u6807\u5fd7\u4f4d\u6570\u7ec4&#xff09;&#xff0c;\u7528 calloc \u66f4\u7701\u4e8b&#xff1b;\u5426\u5219 malloc \u5c31\u884c&#xff08;malloc \u4e0d\u4fdd\u8bc1\u521d\u59cb\u503c\u662f\u4ec0\u4e48&#xff09;\u3002<\/p>\n<h4>1.4 realloc&#xff08;\u8c03\u6574\u5df2\u7533\u8bf7\u7a7a\u95f4\u7684\u5927\u5c0f&#xff09;<\/h4>\n<p>\u6709\u65f6\u5019\u4e00\u5f00\u59cb\u7533\u8bf7\u5c0f\u4e86&#xff0c;\u540e\u9762\u60f3\u6269\u5bb9\u3002\u8fd9\u65f6\u7528 realloc&#xff1a;<\/p>\n<p>void* realloc(void* ptr, size_t size);   \/\/ \u628a ptr \u6307\u5411\u7684\u7a7a\u95f4\u8c03\u6574\u6210 size \u5b57\u8282<\/p>\n<p>\u5b83\u505a\u7684\u4e8b&#xff1a;\u5728 ptr \u7684\u57fa\u7840\u4e0a&#xff0c;\u628a\u7a7a\u95f4\u8c03\u6574\u5230 size \u5b57\u8282\u3002\u6ce8\u610f\u51e0\u4e2a\u5751&#xff1a;<\/p>\n<ul>\n<li>\u8fd4\u56de\u503c\u4e0d\u4e00\u5b9a\u662f\u539f\u6765\u7684 ptr&#xff1a;\u5982\u679c\u539f\u7a7a\u95f4\u540e\u9762\u8fd8\u6709\u7a7a\u4f59&#xff0c;\u5c31\u539f\u5730\u6269\u5bb9&#xff08;\u8fd4\u56de\u539f\u5730\u5740&#xff09;&#xff1b;\u5982\u679c\u540e\u9762\u4e0d\u591f&#xff0c;\u5c31\u53e6\u627e\u4e00\u5757\u66f4\u5927\u7684\u5185\u5b58\u3001\u628a\u539f\u6570\u636e\u62f7\u8fc7\u53bb&#xff08;\u8fd4\u56de\u65b0\u5730\u5740&#xff09;&#xff1b;<\/li>\n<li>\u6240\u4ee5\u5fc5\u987b\u7528\u8fd4\u56de\u503c\u91cd\u65b0\u8d4b\u503c&#xff0c;\u4e0d\u80fd\u5047\u8bbe\u5b83\u8fd8\u662f\u539f\u6765\u90a3\u4e2a\u5730\u5740&#xff1b;<\/li>\n<li>\u7a33\u59a5\u5199\u6cd5&#xff1a;\u5148\u7528\u4e34\u65f6\u6307\u9488\u63a5&#xff0c;\u6210\u529f\u540e\u518d\u8d4b\u503c\u7ed9\u539f\u6307\u9488&#xff0c;\u9632\u6b62\u6269\u5bb9\u5931\u8d25\u65f6\u628a\u539f\u6765\u7684\u5730\u5740\u4e5f\u5f04\u4e22\u4e86\u3002<\/li>\n<\/ul>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    int *p &#061; (int*)malloc(5 * sizeof(int));   \/\/ \u5148\u7533\u8bf7 5 \u4e2a<br \/>\n    if (p &#061;&#061; NULL) return 1;<br \/>\n    for (int i &#061; 0; i &lt; 5; i&#043;&#043;) p[i] &#061; i;<\/p>\n<p>    \/\/ \u6269\u5bb9\u5230 10 \u4e2a&#xff0c;\u7528\u4e34\u65f6\u6307\u9488 tmp \u63a5<br \/>\n    int *tmp &#061; (int*)realloc(p, 10 * sizeof(int));<br \/>\n    if (tmp &#061;&#061; NULL)                          \/\/ \u6269\u5bb9\u5931\u8d25&#xff0c;p \u8fd8\u6307\u5411\u539f\u6765\u7684 5 \u4e2a<br \/>\n    {<br \/>\n        free(p);<br \/>\n        return 1;<br \/>\n    }<br \/>\n    p &#061; tmp;                                  \/\/ \u6210\u529f\u540e\u518d\u628a p \u6362\u6210\u65b0\u5730\u5740<\/p>\n<p>    for (int i &#061; 5; i &lt; 10; i&#043;&#043;) p[i] &#061; i;    \/\/ \u540e\u9762 5 \u4e2a\u4e5f\u586b\u4e0a<br \/>\n    for (int i &#061; 0; i &lt; 10; i&#043;&#043;) printf(&#034;%d &#034;, p[i]);<\/p>\n<p>    free(p);<br \/>\n    p &#061; NULL;<br \/>\n    return 0;<br \/>\n}<\/p>\n<h4>1.5 \u52a8\u6001\u5185\u5b58\u7684\u4e94\u5927\u5e38\u89c1\u9519\u8bef&#xff08;\u9762\u8bd5\u9ad8\u9891&#xff09;<\/h4>\n<p>\u8fd9\u4e9b\u9519\u8bef\u51e0\u4e4e\u6bcf\u4e00\u6761\u90fd\u88ab\u95ee\u8fc7&#xff0c;\u52a1\u5fc5\u4e00\u6761\u6761\u5bf9\u7167\u6392\u67e5&#xff1a;<\/p>\n<p>\u2460 \u5bf9 NULL \u89e3\u5f15\u7528\u2014\u2014\u5fd8\u4e86\u5224\u65ad malloc \u8fd4\u56de\u503c&#xff1a;<\/p>\n<p>int *p &#061; (int*)malloc(1000000000 * sizeof(int));<br \/>\n*p &#061; 10;          \/\/ \u26a0\ufe0f \u5982\u679c malloc \u5931\u8d25\u8fd4\u56de NULL&#xff0c;\u8fd9\u91cc\u5c31\u662f\u5bf9 NULL \u89e3\u5f15\u7528<\/p>\n<p>\u2461 \u8d8a\u754c\u8bbf\u95ee\u2014\u2014\u7533\u8bf7\u4e86 N \u4e2a&#xff0c;\u5374\u8bbf\u95ee\u5230 N \u4e2a\u4e4b\u5916&#xff1a;<\/p>\n<p>int *p &#061; (int*)malloc(10 * sizeof(int));<br \/>\nfor (int i &#061; 0; i &lt;&#061; 10; i&#043;&#043;)   \/\/ \u26a0\ufe0f \u591a\u8bbf\u95ee\u4e86 p[10]&#xff0c;\u8d8a\u754c<br \/>\n    p[i] &#061; i;<\/p>\n<p>\u2462 \u5fd8\u8bb0 free&#xff08;\u5185\u5b58\u6cc4\u6f0f&#xff09;\u2014\u2014\u5c24\u5176\u662f\u5faa\u73af\u91cc\u53cd\u590d malloc \u5374\u4e0d\u91ca\u653e&#xff1a;<\/p>\n<p>while (1)<br \/>\n{<br \/>\n    int *p &#061; (int*)malloc(1024 * 1024);   \/\/ \u6bcf\u6b21\u7533\u8bf7 1MB \u90fd\u4e0d\u91ca\u653e<br \/>\n    \/\/ \u26a0\ufe0f \u5185\u5b58\u8d8a\u7528\u8d8a\u5c11&#xff0c;\u6700\u7ec8\u8017\u5c3d<br \/>\n}<\/p>\n<p>\u2463 free \u4e4b\u540e\u6ca1\u7f6e NULL&#xff08;\u60ac\u5782\u6307\u9488&#xff09;&#xff1a;<\/p>\n<p>int *p &#061; (int*)malloc(sizeof(int));<br \/>\nfree(p);        \/\/ \u91ca\u653e\u4e86<br \/>\n\/\/ p \u8fd8\u7559\u7740\u5df2\u91ca\u653e\u7684\u5730\u5740&#xff0c;\u53d8\u6210\u60ac\u5782\u6307\u9488<br \/>\n*p &#061; 10;        \/\/ \u26a0\ufe0f \u975e\u6cd5\u8bbf\u95ee\u5df2\u91ca\u653e\u7684\u5185\u5b58<\/p>\n<p>\u2464 \u91cd\u590d free \u6216 free \u975e\u52a8\u6001\u5185\u5b58&#xff1a;<\/p>\n<p>int a &#061; 10;<br \/>\nint *p &#061; &amp;a;<br \/>\nfree(p);        \/\/ \u26a0\ufe0f free \u6808\u4e0a\u7684\u53d8\u91cf&#xff0c;\u975e\u6cd5&#xff01;<\/p>\n<p>int *q &#061; (int*)malloc(sizeof(int));<br \/>\nfree(q);<br \/>\nfree(q);        \/\/ \u26a0\ufe0f \u91cd\u590d free \u540c\u4e00\u5757\u5185\u5b58<\/p>\n<p>&#x1f511; \u4e94\u4e2a\u9519\u8bef\u7684\u5e94\u5bf9\u53e3\u8bc0&#xff1a;\u5224 NULL\u3001\u4e0d\u8d8a\u754c\u3001\u8bb0\u5f97 free\u3001free \u540e\u7f6e NULL\u3001\u522b\u91cd\u590d free \u4e5f\u522b free \u6808\u4e0a\u53d8\u91cf\u3002<\/p>\n<h4>1.6 \u67d4\u6027\u6570\u7ec4&#xff08;C99&#xff09;<\/h4>\n<p>\u7ed3\u6784\u4f53\u91cc\u53ef\u4ee5\u6709\u4e00\u4e2a&#034;\u5927\u5c0f\u5f85\u5b9a&#034;\u7684\u6570\u7ec4\u6210\u5458&#xff0c;\u53eb\u67d4\u6027\u6570\u7ec4\u3002\u5b83\u662f\u7ed3\u6784\u4f53\u4e2d\u6700\u540e\u4e00\u4e2a\u6210\u5458&#xff0c;\u5199\u6210 \u7c7b\u578b \u540d[]&#xff08;\u4e0d\u5199\u5927\u5c0f&#xff09;&#xff1a;<\/p>\n<p>struct S<br \/>\n{<br \/>\n    int n;          \/\/ \u666e\u901a\u6210\u5458<br \/>\n    int arr[];      \/\/ \u67d4\u6027\u6570\u7ec4\u6210\u5458&#xff1a;\u5927\u5c0f\u5f85\u5b9a<br \/>\n};<\/p>\n<p>\u67d4\u6027\u6570\u7ec4\u4e0d\u80fd\u5355\u72ec\u7528&#xff0c;\u8981\u914d\u5408 malloc \u4e00\u8d77\u628a\u7ed3\u6784\u4f53\u548c\u6570\u7ec4\u4e00\u6b21\u6027\u7533\u8bf7\u51fa\u6765&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\nstruct S<br \/>\n{<br \/>\n    int n;<br \/>\n    int arr[];      \/\/ \u67d4\u6027\u6570\u7ec4<br \/>\n};<br \/>\nint main()<br \/>\n{<br \/>\n    \/\/ \u4e00\u6b21\u6027\u7533\u8bf7&#xff1a;\u7ed3\u6784\u4f53\u5927\u5c0f &#043; 10 \u4e2a int \u7684\u5927\u5c0f<br \/>\n    struct S *ps &#061; (struct S*)malloc(sizeof(struct S) &#043; 10 * sizeof(int));<br \/>\n    if (ps &#061;&#061; NULL) return 1;<\/p>\n<p>    ps-&gt;n &#061; 10;<br \/>\n    for (int i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        ps-&gt;arr[i] &#061; i;      \/\/ arr \u5c31\u662f\u7d27\u8ddf\u5728\u7ed3\u6784\u4f53\u540e\u9762\u7684\u90a3 10 \u4e2a int<\/p>\n<p>    for (int i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        printf(&#034;%d &#034;, ps-&gt;arr[i]);<\/p>\n<p>    free(ps);<br \/>\n    ps &#061; NULL;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u597d\u5904&#xff1a;\u7ed3\u6784\u4f53\u548c\u5b83\u7684\u6570\u7ec4\u5728\u5185\u5b58\u91cc\u662f\u8fde\u7eed\u7684\u4e00\u5757&#xff0c;free \u4e00\u6b21\u5c31\u5168\u91ca\u653e&#xff0c;\u4e0d\u7528\u5206\u5f00\u7ba1&#xff1b;\u4e5f\u907f\u514d\u4e86&#034;\u7ed3\u6784\u4f53\u91cc\u5199\u6b7b\u5927\u6570\u7ec4&#034;\u7684\u6d6a\u8d39\u3002<\/p>\n<p>&#x1f511; \u67d4\u6027\u6570\u7ec4\u7684\u8981\u70b9&#xff1a;\u5fc5\u987b\u662f\u6700\u540e\u4e00\u4e2a\u6210\u5458\u3001\u5fc5\u987b\u5199\u6210 arr[]\u3001\u5fc5\u987b\u914d\u5408 malloc \u4e00\u6b21\u7533\u8bf7 sizeof(struct) &#043; n * sizeof(\u5143\u7d20)\u3002<\/p>\n<\/p>\n<hr \/>\n<h3>\u4e8c\u3001mem \u7cfb\u5217\u5185\u5b58\u51fd\u6570&#xff08;void* \u7684\u5b9e\u6218&#xff09;<\/h3>\n<p>\u6307\u9488(4)\u91cc\u6211\u4eec\u8ba4\u8bc6\u4e86 void*\u2014\u2014&#034;\u5148\u63a5\u4f4f\u4efb\u610f\u7c7b\u578b\u7684\u5730\u5740&#034;\u3002\u5e93\u51fd\u6570\u91cc\u6709\u4e00\u6574\u5957\u4ee5 void* \u4e3a\u6838\u5fc3\u7684\u5185\u5b58\u51fd\u6570&#xff0c;\u5c31\u662f void* \u6700\u7ecf\u5178\u7684\u5b9e\u6218&#xff1a;\u5b83\u4eec\u4e0d\u7ba1\u6570\u636e\u7c7b\u578b&#xff0c;\u76f4\u63a5\u6309\u5b57\u8282\u64cd\u4f5c\u5185\u5b58\u3002\u90fd\u5728 &lt;string.h&gt; \u91cc\u3002<\/p>\n<h4>2.1 memcpy&#xff08;\u6309\u5b57\u8282\u62f7\u8d1d&#xff0c;\u4e0d\u5904\u7406\u91cd\u53e0&#xff09;<\/h4>\n<p>void* memcpy(void* dest, const void* src, size_t num);<\/p>\n<p>\u628a src \u5f00\u59cb\u7684 num \u4e2a\u5b57\u8282&#xff0c;\u62f7\u8d1d\u5230 dest \u5f00\u59cb\u7684\u4f4d\u7f6e&#xff0c;\u8fd4\u56de dest\u3002\u5b83\u4e0d\u8d1f\u8d23\u5904\u7406\u5185\u5b58\u91cd\u53e0\u7684\u60c5\u51b5\u3002<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    int arr1[] &#061; { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };<br \/>\n    int arr2[10] &#061; { 0 };<br \/>\n    memcpy(arr2, arr1, 10 * sizeof(int));   \/\/ \u62f7\u8d1d 10 \u4e2a int&#xff08;\u5171 40 \u5b57\u8282&#xff09;<br \/>\n    for (int i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        printf(&#034;%d &#034;, arr2[i]);             \/\/ 1 2 3 4 5 6 7 8 9 10<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u81ea\u5df1\u6a21\u62df\u5b9e\u73b0\u4e00\u4e2a memcpy&#xff0c;\u6838\u5fc3\u5c31\u662f&#034;\u8f6c\u6210 char* \u6309\u5b57\u8282\u4e00\u4e2a\u4e2a\u642c&#034;&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nvoid* my_memcpy(void* dest, const void* src, size_t num)<br \/>\n{<br \/>\n    char* d &#061; (char*)dest;<br \/>\n    const char* s &#061; (const char*)src;<br \/>\n    while (num&#8211;)<br \/>\n        *d&#043;&#043; &#061; *s&#043;&#043;;        \/\/ \u4e00\u4e2a\u5b57\u8282\u4e00\u4e2a\u5b57\u8282\u5730\u62f7\u8d1d<br \/>\n    return dest;<br \/>\n}<\/p>\n<h4>2.2 memmove&#xff08;\u6309\u5b57\u8282\u62f7\u8d1d&#xff0c;\u5904\u7406\u91cd\u53e0&#xff09;<\/h4>\n<p>memcpy \u7684\u77ed\u677f\u662f\u4e0d\u5904\u7406\u91cd\u53e0\u3002\u5982\u679c dest \u548c src \u6307\u5411\u7684\u533a\u95f4\u6709\u91cd\u53e0&#xff0c;\u76f4\u63a5\u4ece\u524d\u5f80\u540e\u62f7\u8d1d\u4f1a\u628a&#034;\u8fd8\u6ca1\u62f7\u8d1d\u7684\u6e90\u6570\u636e&#034;\u5148\u8986\u76d6\u6389&#xff0c;\u7ed3\u679c\u5c31\u9519\u4e86\u3002\u8fd9\u65f6\u7528 memmove&#xff1a;<\/p>\n<p>void* memmove(void* dest, const void* src, size_t num);<\/p>\n<p>memmove \u4f1a\u5224\u65ad\u62f7\u8d1d\u65b9\u5411&#xff0c;\u4ece\u800c\u6b63\u786e\u5904\u7406\u91cd\u53e0&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    int arr[] &#061; { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };<br \/>\n    \/\/ \u628a 1 2 3 4 5 \u6574\u4f53\u5f80\u540e\u632a\u4e24\u4e2a\u4f4d\u7f6e&#xff0c;\u53d8\u6210 1 2 1 2 3 4 5 8 9 10<br \/>\n    memmove(arr &#043; 2, arr, 5 * sizeof(int));<br \/>\n    for (int i &#061; 0; i &lt; 10; i&#043;&#043;)<br \/>\n        printf(&#034;%d &#034;, arr[i]);<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u8fd9\u91cc src&#xff08;arr&#xff09;\u548c dest&#xff08;arr&#043;2&#xff09;\u6709\u91cd\u53e0&#xff0c;memmove \u80fd\u6b63\u786e\u5904\u7406&#xff1b;\u6362\u6210 memcpy \u7ed3\u679c\u5c31\u53ef\u80fd\u4e0d\u5bf9\u3002<\/p>\n<p>\u6a21\u62df\u5b9e\u73b0\u7684\u5173\u952e&#xff1a;\u5f53 dest \u5728 src \u524d\u9762&#xff0c;\u4ece\u524d\u5411\u540e\u62f7\u8d1d&#xff1b;\u5f53 dest \u5728 src \u540e\u9762&#xff0c;\u4ece\u540e\u5411\u524d\u62f7\u8d1d&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nvoid* my_memmove(void* dest, const void* src, size_t num)<br \/>\n{<br \/>\n    char* d &#061; (char*)dest;<br \/>\n    const char* s &#061; (const char*)src;<br \/>\n    if (d &lt; s)                 \/\/ dest \u5728 src \u524d\u9762&#xff1a;\u4ece\u524d\u5f80\u540e<br \/>\n    {<br \/>\n        while (num&#8211;)<br \/>\n            *d&#043;&#043; &#061; *s&#043;&#043;;<br \/>\n    }<br \/>\n    else                       \/\/ dest \u5728 src \u540e\u9762&#xff1a;\u4ece\u540e\u5f80\u524d<br \/>\n    {<br \/>\n        while (num&#8211;)<br \/>\n            *(d &#043; num) &#061; *(s &#043; num);<br \/>\n    }<br \/>\n    return dest;<br \/>\n}<\/p>\n<p>&#x1f511; \u4e00\u53e5\u8bdd\u8bb0\u4f4f&#xff1a;memcpy \u4e0d\u5904\u7406\u91cd\u53e0&#xff0c;memmove \u5904\u7406\u91cd\u53e0\u3002\u62ff\u4e0d\u51c6\u4f1a\u4e0d\u4f1a\u91cd\u53e0\u65f6&#xff0c;\u7528 memmove \u66f4\u7a33\u59a5\u3002\u4e24\u8005\u7684\u6a21\u62df\u5b9e\u73b0\u90fd\u9760&#034;\u8f6c char* \u6309\u5b57\u8282\u64cd\u4f5c&#034;\u3002<\/p>\n<\/p>\n<h4>2.3 memset&#xff08;\u628a\u5185\u5b58\u6279\u91cf\u8bbe\u4e3a\u67d0\u4e2a\u503c&#xff09;<\/h4>\n<p>void* memset(void* ptr, int value, size_t num);<\/p>\n<p>\u628a ptr \u5f00\u59cb\u7684 num \u4e2a\u5b57\u8282&#xff0c;\u6bcf\u4e2a\u5b57\u8282\u90fd\u8bbe\u6210 value&#xff08;\u6ce8\u610f\u662f\u6309\u5b57\u8282\u8bbe\u503c&#xff0c;value \u53ea\u53d6\u4f4e 8 \u4f4d&#xff09;\u3002<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    char arr[] &#061; &#034;hello world&#034;;<br \/>\n    memset(arr &#043; 6, &#039;x&#039;, 5);     \/\/ \u4ece\u7b2c 6 \u4e2a\u5b57\u7b26\u5f00\u59cb&#xff0c;5 \u4e2a\u5b57\u8282\u90fd\u8bbe\u6210 &#039;x&#039;<br \/>\n    printf(&#034;%s\\\\n&#034;, arr);         \/\/ &#034;hello xxxxx&#034;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u6a21\u62df\u5b9e\u73b0&#xff1a;<\/p>\n<p>void* my_memset(void* ptr, int value, size_t num)<br \/>\n{<br \/>\n    char* p &#061; (char*)ptr;<br \/>\n    while (num&#8211;)<br \/>\n        *p&#043;&#043; &#061; (char)value;      \/\/ \u6309\u5b57\u8282\u8bbe\u7f6e<br \/>\n    return ptr;<br \/>\n}<\/p>\n<p>\u26a0\ufe0f \u6ce8\u610f&#xff1a;memset \u6309\u5b57\u8282\u8bbe\u503c&#xff0c;\u6240\u4ee5\u7528 memset(arr, 1, sizeof(arr)) \u7ed9\u6574\u578b\u6570\u7ec4&#034;\u8bbe\u6210 1&#034;\u662f\u9519\u7684\u2014\u2014\u6bcf\u4e2a int \u7684 4 \u4e2a\u5b57\u8282\u90fd\u4f1a\u53d8\u6210 0x01&#xff0c;\u7ed3\u679c\u6bcf\u4e2a\u5143\u7d20\u662f 0x01010101 \u800c\u4e0d\u662f 1\u3002\u7ed9\u6574\u578b\u6570\u7ec4\u6e05\u96f6\u7528 memset(arr, 0, sizeof(arr)) \u6ca1\u95ee\u9898&#xff08;\u56e0\u4e3a 0 \u7684 4 \u4e2a\u5b57\u8282\u90fd\u662f 0&#xff09;\u3002<\/p>\n<h4>2.4 memcmp&#xff08;\u6309\u5b57\u8282\u6bd4\u8f83&#xff09;<\/h4>\n<p>int memcmp(const void* ptr1, const void* ptr2, size_t num);<\/p>\n<p>\u6bd4\u8f83 ptr1 \u548c ptr2 \u5f00\u5934\u7684 num \u4e2a\u5b57\u8282&#xff0c;\u8fd4\u56de\u503c\u548c strcmp \u4e00\u4e2a\u7ea6\u5b9a&#xff08;p1 &#8211; p2 \u7684\u7b26\u53f7&#xff09;&#xff1a;<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\nint main()<br \/>\n{<br \/>\n    int arr1[] &#061; { 1, 2, 3, 4, 5 };<br \/>\n    int arr2[] &#061; { 1, 2, 3, 4, 6 };<br \/>\n    int ret &#061; memcmp(arr1, arr2, 5 * sizeof(int));<br \/>\n    printf(&#034;%d\\\\n&#034;, ret);   \/\/ \u8d1f\u6570&#xff1a;arr1 \u6700\u540e\u4e00\u4e2a\u5143\u7d20 5 &lt; arr2 \u7684 6<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u6a21\u62df\u5b9e\u73b0&#xff1a;<\/p>\n<p>int my_memcmp(const void* ptr1, const void* ptr2, size_t num)<br \/>\n{<br \/>\n    const char* p1 &#061; (const char*)ptr1;<br \/>\n    const char* p2 &#061; (const char*)ptr2;<br \/>\n    while (num&#8211;)<br \/>\n    {<br \/>\n        if (*p1 !&#061; *p2)<br \/>\n            return *p1 &#8211; *p2;   \/\/ \u7b2c\u4e00\u4e2a\u4e0d\u76f8\u7b49\u7684\u5b57\u8282&#xff0c;\u8c01\u5927\u8c01\u5c0f<br \/>\n        p1&#043;&#043;;<br \/>\n        p2&#043;&#043;;<br \/>\n    }<br \/>\n    return 0;                    \/\/ num \u4e2a\u5b57\u8282\u5168\u76f8\u7b49<br \/>\n}<\/p>\n<p>&#x1f511; \u8fd9\u4e00\u8282\u56db\u4e2a\u51fd\u6570&#xff0c;\u672c\u8d28\u90fd\u662f&#034;\u8f6c char* &#043; \u6309\u5b57\u8282\u5faa\u73af&#034;\u3002\u770b\u61c2\u8fd9\u4e2a\u5957\u8def&#xff0c;void* \u6cdb\u578b\u6307\u9488\u7684\u5b9e\u6218\u5c31\u7b97\u5165\u95e8\u4e86\u2014\u2014\u5b83\u4e0d\u5173\u5fc3\u4f60\u4f20\u7684\u662f int*\u3001char* \u8fd8\u662f\u7ed3\u6784\u4f53&#xff0c;\u4e00\u5f8b\u6309\u5b57\u8282\u5904\u7406\u3002<\/p>\n<hr \/>\n<h3>\u4e09\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\u4e0e&#034;\u53f3\u5de6\u6cd5\u5219&#034;<\/h3>\n<p>\u524d\u9762\u51e0\u8bb2&#xff0c;\u6211\u4eec\u89c1\u8fc7 int (*p)[5]\u3001int (*pf)(int,int) \u8fd9\u4e9b&#xff0c;\u5df2\u7ecf\u6709\u70b9\u7ed5\u4e86\u3002\u53ef\u771f\u5b9e\u4ee3\u7801&#xff08;\u5c24\u5176\u770b\u5e93\u3001\u770b\u5185\u6838\u3001\u770b\u9762\u8bd5\u9898&#xff09;\u91cc&#xff0c;\u8fd8\u6709\u66f4&#034;\u5929\u4e66&#034;\u7684&#xff0c;\u6bd4\u5982&#xff1a;<\/p>\n<p>void (*signal(int , void(*)(int)))(int);<br \/>\nint (*(*p)[5])(int);<\/p>\n<p>\u8fd9\u4e00\u8282&#xff0c;\u5c31\u7528\u4e00\u4e2a\u901a\u7528\u65b9\u6cd5\u628a\u4efb\u610f\u590d\u6742\u58f0\u660e\u8bfb\u51fa\u6765\u3002<\/p>\n<h4>3.1 \u8bb0\u4f4f\u4e24\u6761\u4f18\u5148\u7ea7<\/h4>\n<p>\u8bfb\u58f0\u660e\u524d&#xff0c;\u5148\u8bb0\u4f4f\u7b26\u53f7\u7684\u4f18\u5148\u7ea7&#xff08;\u548c\u8fd0\u7b97\u7b26\u4f18\u5148\u7ea7\u4e00\u81f4&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\u62ec\u53f7 () \u4f18\u5148\u7ea7\u6700\u9ad8&#xff0c;\u4f18\u5148\u770b\u62ec\u53f7\u91cc\u7684&#xff1b;<\/li>\n<li>[]&#xff08;\u6570\u7ec4&#xff09;\u548c ()&#xff08;\u51fd\u6570&#xff09;\u540c\u7ea7&#xff0c;\u90fd\u9ad8\u4e8e *&#xff08;\u6307\u9488&#xff09;\u3002<\/li>\n<\/ul>\n<p>\u6240\u4ee5 int *p[5] \u91cc p \u5148\u548c [5] \u7ed3\u5408&#xff08;\u662f\u6570\u7ec4&#xff09;&#xff1b;int (*p)[5] \u91cc\u62ec\u53f7\u8ba9 p \u5148\u548c * \u7ed3\u5408&#xff08;\u662f\u6307\u9488&#xff09;\u3002\u8fd9\u6761\u524d\u51e0\u8bb2\u5df2\u7ecf\u53cd\u590d\u7528\u4e86\u3002<\/p>\n<h4>3.2 \u53f3\u5de6\u6cd5\u5219&#xff1a;\u4ece\u53d8\u91cf\u540d\u51fa\u53d1&#xff0c;\u5148\u53f3\u540e\u5de6<\/h4>\n<p>\u53f3\u5de6\u6cd5\u5219\u7684\u6b65\u9aa4&#xff1a;\u4ece\u53d8\u91cf\u540d&#xff08;\u6700\u5185\u5c42\u7684\u540d\u5b57&#xff09;\u51fa\u53d1&#xff0c;\u5148\u5411\u53f3\u770b&#xff0c;\u9047\u5230 ) \u5c31\u5411\u5de6\u770b&#xff0c;\u9047\u5230 ( \u518d\u5411\u53f3\u770b\u2026\u2026\u50cf&#034;\u4e4b&#034;\u5b57\u5f62\u4e00\u6837\u4ea4\u66ff&#xff0c;\u76f4\u5230\u8bfb\u5b8c\u6574\u4e2a\u58f0\u660e\u3002<\/p>\n<p>\u5148\u62ff\u4e24\u4e2a\u5df2\u7ecf\u719f\u6089\u7684\u6765\u7ec3\u624b&#xff1a;<\/p>\n<p>\u4f8b 1&#xff1a;int (*p)[5]<\/p>\n<li>\u4ece p \u51fa\u53d1&#xff0c;\u53f3\u8fb9\u662f )&#xff0c;\u4e8e\u662f\u5411\u5de6\u770b&#xff0c;\u770b\u5230 * \u2192 p \u662f\u6307\u9488&#xff1b;<\/li>\n<li>\u518d\u5411\u53f3\u770b&#xff0c;\u770b\u5230 [5] \u2192 \u6307\u9488\u6307\u5411\u4e00\u4e2a\u6709 5 \u4e2a\u5143\u7d20\u7684\u6570\u7ec4&#xff1b;<\/li>\n<li>\u5269\u4e0b\u7684 int \u662f\u6570\u7ec4\u5143\u7d20\u7c7b\u578b\u3002<\/li>\n<p>\u8bfb\u4f5c&#xff1a;p \u662f\u4e00\u4e2a\u6307\u9488&#xff0c;\u6307\u5411&#034;\u6709 5 \u4e2a int \u7684\u6570\u7ec4&#034;&#xff08;\u5373\u6570\u7ec4\u6307\u9488&#xff09;\u3002<\/p>\n<p>\u4f8b 2&#xff1a;int (*p[5])(int)<\/p>\n<li>\u4ece p \u51fa\u53d1&#xff0c;p \u5148\u548c [5] \u7ed3\u5408 \u2192 p \u662f\u6570\u7ec4&#xff08;\u6709 5 \u4e2a\u5143\u7d20&#xff09;&#xff1b;<\/li>\n<li>\u518d\u770b\u6570\u7ec4\u7684\u5143\u7d20\u7c7b\u578b (*&#8230;)(int) \u2192 \u662f\u51fd\u6570\u6307\u9488&#xff08;\u6307\u5411\u53c2\u6570 int\u3001\u8fd4\u56de int \u7684\u51fd\u6570&#xff09;\u3002<\/li>\n<p>\u8bfb\u4f5c&#xff1a;p \u662f\u4e00\u4e2a\u6570\u7ec4&#xff0c;\u6709 5 \u4e2a\u5143\u7d20&#xff0c;\u6bcf\u4e2a\u5143\u7d20\u662f&#034;\u6307\u5411 int \u51fd\u6570\u7684\u6307\u9488&#034;&#xff08;\u5373\u51fd\u6570\u6307\u9488\u6570\u7ec4&#xff0c;\u6307\u9488(3)\u91cc\u7684&#034;\u8f6c\u79fb\u8868&#034;&#xff09;\u3002<\/p>\n<h4>3.3 \u4e0a\u5f3a\u5ea6&#xff1a;\u62c6\u4e00\u4e2a\u771f\u6b63\u590d\u6742\u7684\u4e09\u7ea7\u5d4c\u5957<\/h4>\n<p>\u770b\u8fd9\u4e2a&#xff1a;<\/p>\n<p>int (*(*p)[5])(int);<\/p>\n<p>\u7528\u53f3\u5de6\u6cd5\u5219\u4e00\u6b65\u6b65\u62c6&#xff1a;<\/p>\n<li>\u4ece p \u51fa\u53d1&#xff0c;\u53f3\u8fb9\u662f )&#xff0c;\u5411\u5de6\u770b\u662f * \u2192 p \u662f\u6307\u9488&#xff1b;<\/li>\n<li>\u5411\u53f3\u770b\u662f [5] \u2192 \u6307\u9488\u6307\u5411\u6709 5 \u4e2a\u5143\u7d20\u7684\u6570\u7ec4&#xff1b;<\/li>\n<li>\u6570\u7ec4\u5143\u7d20\u662f\u4ec0\u4e48&#xff1f;\u5f80\u5de6\u770b\u662f *&#xff08;(*p)[5] \u91cc\u53bb\u6389 p \u8fd8\u5269 (*)[5]&#xff0c;\u5143\u7d20\u662f *&#xff09;\u2192 \u6570\u7ec4\u5143\u7d20\u662f\u6307\u9488&#xff1b;<\/li>\n<li>\u8fd9\u4e2a\u6307\u9488\u6307\u5411\u4ec0\u4e48&#xff1f;\u5411\u53f3\u770b\u662f (int) \u2192 \u6307\u5411\u53c2\u6570\u4e3a int \u7684\u51fd\u6570&#xff1b;<\/li>\n<li>\u5de6\u8fb9\u5269\u4e0b\u7684 int \u662f\u51fd\u6570\u8fd4\u56de\u7c7b\u578b\u3002<\/li>\n<p>\u8bfb\u4f5c&#xff1a;p \u662f\u4e00\u4e2a\u6307\u9488&#xff0c;\u6307\u5411&#034;\u6709 5 \u4e2a\u5143\u7d20&#034;\u7684\u6570\u7ec4&#xff1b;\u8fd9\u4e2a\u6570\u7ec4\u7684\u6bcf\u4e2a\u5143\u7d20\u53c8\u662f\u4e00\u4e2a\u6307\u9488&#xff0c;\u6307\u5411&#034;\u53c2\u6570 int\u3001\u8fd4\u56de int&#034;\u7684\u51fd\u6570\u3002<\/p>\n<p>\u5199\u6210\u7c7b\u578b\u5c31\u662f&#xff1a;int (*(*)[5])(int)\u3002\u770b\u7740\u5413\u4eba&#xff0c;\u7528\u53f3\u5de6\u6cd5\u5219&#034;\u4e4b&#034;\u5b57\u5f62\u4e00\u8bfb\u5c31\u901a\u4e86\u3002<\/p>\n<p>&#x1f511; \u53f3\u5de6\u6cd5\u5219\u7684\u53e3\u8bc0&#xff1a;\u53d8\u91cf\u540d\u51fa\u53d1&#xff0c;\u53f3\u5de6\u53f3\u5de6\u4ea4\u66ff\u8d70\u3002\u770b\u5230 [n] \u8bf4&#034;\u6570\u7ec4&#034;&#xff0c;\u770b\u5230 * \u8bf4&#034;\u6307\u9488&#034;&#xff0c;\u770b\u5230 (\u53c2\u6570) \u8bf4&#034;\u51fd\u6570&#034;&#xff0c;\u6700\u540e\u5269\u4e0b\u7684\u7c7b\u578b\u662f&#034;\u8fd4\u56de\u503c\/\u5143\u7d20\u7c7b\u578b&#034;\u3002<\/p>\n<\/p>\n<h4>3.4 \u7528 typedef \u628a\u590d\u6742\u58f0\u660e&#034;\u5316\u7e41\u4e3a\u7b80&#034;<\/h4>\n<p>\u53f3\u5de6\u6cd5\u5219\u80fd&#034;\u8bfb\u61c2&#034;&#xff0c;\u4f46\u771f\u5199\u4ee3\u7801\u65f6\u6ca1\u4eba\u613f\u610f\u6bcf\u6b21\u5199\u4e00\u5927\u5768\u3002\u66f4\u5b9e\u7528\u7684\u505a\u6cd5\u662f\u7528 typedef \u7ed9\u590d\u6742\u7c7b\u578b\u8d77\u4e2a\u7b80\u5355\u540d\u5b57&#xff08;\u6307\u9488(3)\u91cc\u4e5f\u63d0\u8fc7&#xff1a;\u65b0\u540d\u5b57\u8981\u5199\u5728 * \u7684\u53f3\u8fb9&#xff09;\u3002<\/p>\n<p>\u5148\u770b\u5e93\u91cc\u7684\u7ecf\u5178 signal \u51fd\u6570&#xff08;\u7528\u6765\u6ce8\u518c\u4fe1\u53f7\u5904\u7406\u51fd\u6570&#xff09;&#xff0c;\u539f\u578b&#xff1a;<\/p>\n<p>void (*signal(int , void(*)(int)))(int);<\/p>\n<p>\u7b2c\u4e00\u6b21\u770b\u57fa\u672c\u61f5\u3002\u7528 typedef \u62c6\u4e24\u6b65&#xff1a;<\/p>\n<p>\/\/ \u7b2c 1 \u6b65&#xff1a;\u628a&#034;\u51fd\u6570\u6307\u9488\u7c7b\u578b void(*)(int)&#034;\u91cd\u547d\u540d\u6210 sighandler_t<br \/>\ntypedef void (*sighandler_t)(int);<\/p>\n<p>\/\/ \u7b2c 2 \u6b65&#xff1a;signal \u5c31\u53d8\u6210\u2014\u2014\u53c2\u6570\u662f int \u548c\u4e00\u4e2a\u51fd\u6570\u6307\u9488&#xff0c;\u8fd4\u56de\u4e5f\u662f\u51fd\u6570\u6307\u9488<br \/>\nsighandler_t signal(int signum, sighandler_t handler);<\/p>\n<p>\u8fd9\u6837\u4e00\u773c\u5c31\u61c2&#xff1a;signal \u63a5\u6536\u4e00\u4e2a\u4fe1\u53f7\u7f16\u53f7 int \u548c\u4e00\u4e2a\u5904\u7406\u51fd\u6570&#xff08;sighandler_t&#xff09;&#xff0c;\u8fd4\u56de\u4e4b\u524d\u7684\u90a3\u4e2a\u5904\u7406\u51fd\u6570&#xff08;\u4e5f\u662f sighandler_t&#xff09;\u3002<\/p>\n<p>\u518d\u6bd4\u5982\u4e0a\u4e00\u8282\u90a3\u4e2a\u4e09\u7ea7\u5d4c\u5957 int (*(*p)[5])(int)&#xff0c;\u7528 typedef \u4e5f\u80fd\u62c6&#xff1a;<\/p>\n<p>typedef int (*pfun_t)(int);     \/\/ \u6307\u5411&#034;int -&gt; int&#034;\u51fd\u6570\u7684\u6307\u9488\u7c7b\u578b<br \/>\ntypedef pfun_t arr5_t[5];       \/\/ \u5b58 5 \u4e2a\u51fd\u6570\u6307\u9488\u7684\u6570\u7ec4\u7c7b\u578b<br \/>\narr5_t *p;                      \/\/ \u6307\u5411\u8fd9\u4e2a\u6570\u7ec4\u7684\u6307\u9488<\/p>\n<p>\u4e09\u884c&#xff0c;\u6e05\u695a\u591a\u4e86\u3002<\/p>\n<p>&#x1f511; \u590d\u6742\u58f0\u660e\u7684\u7ec8\u6781\u5fc3\u6cd5&#xff1a;\u8bfb\u7528&#034;\u53f3\u5de6\u6cd5\u5219&#034;&#xff0c;\u5199\u7528&#034;typedef&#034;\u3002\u53f3\u624b\u6cd5\u5219\u8d1f\u8d23&#034;\u770b\u61c2\u5929\u4e66&#034;&#xff0c;typedef \u8d1f\u8d23&#034;\u522b\u81ea\u5df1\u5199\u5929\u4e66&#034;\u3002<\/p>\n<hr \/>\n<h3>\u603b\u7ed3<\/h3>\n<p>\u6700\u540e\u628a\u8fd9\u4e00\u7bc7\u8865\u5145\u7684\u9aa8\u67b6\u62ce\u51fa\u6765&#xff1a;<\/p>\n<li>\u52a8\u6001\u5185\u5b58\u5206\u914d&#xff1a;\u6808\u533a\u81ea\u52a8\u7ba1\u7406\u3001\u5806\u533a\u624b\u52a8\u7ba1\u7406&#xff1b;malloc(size) \u7533\u8bf7\u3001free(ptr) \u91ca\u653e&#xff0c;\u5fc5\u987b\u6210\u5bf9\u3002<\/li>\n<li>\u56db\u4e2a\u5206\u914d\u51fd\u6570&#xff1a;malloc \u4e0d\u521d\u59cb\u5316\u3001calloc \u81ea\u52a8\u6e05\u96f6\u3001realloc \u8c03\u6574\u5927\u5c0f&#xff08;\u8981\u7528\u4e34\u65f6\u6307\u9488\u63a5\u3001\u6210\u529f\u540e\u91cd\u65b0\u8d4b\u503c&#xff09;\u3001free \u91ca\u653e\u3002<\/li>\n<li>\u4e94\u5927\u5e38\u89c1\u9519\u8bef&#xff1a;\u5bf9 NULL \u89e3\u5f15\u7528\u3001\u8d8a\u754c\u8bbf\u95ee\u3001\u5fd8\u8bb0 free&#xff08;\u6cc4\u6f0f&#xff09;\u3001free \u540e\u6ca1\u7f6e NULL&#xff08;\u60ac\u5782\u6307\u9488&#xff09;\u3001\u91cd\u590d free \/ free \u6808\u4e0a\u53d8\u91cf\u3002<\/li>\n<li>\u67d4\u6027\u6570\u7ec4&#xff1a;\u7ed3\u6784\u4f53\u6700\u540e\u4e00\u4e2a\u6210\u5458\u5199\u6210 int arr[]&#xff0c;\u914d\u5408 malloc(sizeof(struct) &#043; n*sizeof(\u5143\u7d20)) \u4e00\u6b21\u6027\u7533\u8bf7\u6210\u8fde\u7eed\u4e00\u5757\u3002<\/li>\n<li>mem \u7cfb\u5217\u5185\u5b58\u51fd\u6570&#xff1a;memcpy\/memmove&#xff08;\u62f7\u8d1d&#xff0c;\u540e\u8005\u5904\u7406\u91cd\u53e0&#xff09;\u3001memset&#xff08;\u6309\u5b57\u8282\u8bbe\u503c&#xff09;\u3001memcmp&#xff08;\u6309\u5b57\u8282\u6bd4\u8f83&#xff09;&#xff1b;\u672c\u8d28\u90fd\u662f&#034;\u8f6c char* \u6309\u5b57\u8282\u5faa\u73af&#034;\u3002<\/li>\n<li>\u590d\u6742\u58f0\u660e&#xff1a;\u8bfb\u7528\u53f3\u5de6\u6cd5\u5219&#xff08;\u4ece\u53d8\u91cf\u540d\u51fa\u53d1&#xff0c;\u53f3\u5de6\u53f3\u5de6\u4ea4\u66ff&#xff09;&#xff0c;\u5199\u7528 typedef&#xff08;\u65b0\u540d\u5b57\u5199\u5728 * \u53f3\u8fb9&#xff09;\u3002<\/li>\n<p>\u4e00\u53e5\u8bdd\u6536\u5c3e&#xff1a;\u6307\u9488\u5b66\u5230\u6df1\u5904&#xff0c;\u5c31\u4e09\u4ef6\u4e8b\u2014\u2014\u5806\u4e0a\u5185\u5b58\u8981&#034;\u624b\u52a8\u7533\u8bf7\u624b\u52a8\u8fd8&#034;\u3001\u5185\u5b58\u51fd\u6570\u8981&#034;\u6309\u5b57\u8282\u64cd\u4f5c&#034;\u3001\u590d\u6742\u58f0\u660e\u8981&#034;\u53f3\u5de6\u6cd5\u5219\u62c6\u7740\u8bfb&#034;&#xff1b;\u628a\u8fd9\u4e09\u5757\u8865\u9f50&#xff0c;\u6307\u9488\u624d\u7b97\u662f\u771f\u6b63\u6bd5\u4e1a\u4e86\u3002<\/p>\n<h3>\u62d3\u5c55\u5b66\u4e60<\/h3>\n<ul>\n<li>\u52a8\u6001\u5185\u5b58\u4e0e\u7ed3\u6784\u4f53\u7684\u7ed3\u5408&#xff1a;\u94fe\u8868\u3001\u6808\u3001\u961f\u5217\u8fd9\u4e9b\u6570\u636e\u7ed3\u6784&#xff0c;\u90fd\u662f\u9760&#034;\u7ed3\u6784\u4f53\u6307\u9488 &#043; malloc&#034;\u5806\u51fa\u6765\u7684&#xff08;\u6570\u636e\u7ed3\u6784\u8bfe\u7684\u6838\u5fc3&#xff09;\u3002<\/li>\n<li>\u5185\u5b58\u6cc4\u6f0f\u6392\u67e5\u5de5\u5177&#xff1a;valgrind\u3001AddressSanitizer&#xff08;ASan&#xff09;\u80fd\u5e2e\u4f60\u81ea\u52a8\u67e5\u51fa&#034;\u54ea\u5757\u5185\u5b58\u6ca1\u91ca\u653e\u3001\u54ea\u6b21\u8d8a\u754c\u4e86&#034;\u3002<\/li>\n<li>restrict \u5173\u952e\u5b57&#xff1a;C99 \u91cc\u7ed9\u6307\u9488\u52a0&#034;\u4e0d\u91cd\u53e0&#034;\u7684\u63d0\u793a&#xff0c;\u5e2e\u52a9\u7f16\u8bd1\u5668\u4f18\u5316&#xff08;memcpy \u7684\u5f62\u53c2\u5c31\u7528\u4e86 restrict&#xff09;\u3002<\/li>\n<li>\u4e0a\u4e00\u8bb2&#xff1a;\u6df1\u5165\u7406\u89e3\u6307\u9488(5)&#xff08;sizeof \u4e0e strlen \u5bf9\u6bd4\u3001\u6570\u7ec4\u540d\u4e09\u5927\u89c4\u5219\u3001\u6307\u9488\u8fd0\u7b97\u7b14\u8bd5\u9898&#xff09;<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u4e2a\u4eba\u4e3b\u9875&#xff1a;GeekZHR\u00a0 \u00a0\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u4e92\u4e09<br \/>\n25\u7ea7\u673a\u5668\u4eba\u5de5\u7a0bN\u975e\u672c\u79d1\u751f\u5728\u8bfb&#xff0c;\u81ea\u5b66C\/C&#xff0c;\u5d4c\u5165\u5f0f\u8f6f\u786c\u4ef6\u7b49\u7b49ing<br \/>\n\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8bc4\u8bba\u533a\u4e92\u52a8\u4ea4\u6d41 \u5199\u5728\u524d\u9762&#xff1a;\u524d\u4e94\u8bb2\\&#8221;\u7559\u7684\u5c3e\u5df4\\&#8221;&#xff0c;\u90fd\u5728\u8fd9\u4e00\u7bc7\u8865\u4e0a<br \/>\n\u524d\u4e94\u8bb2&#xff0c;\u6211\u4eec\u4e00\u8def\u4ece\\&#8221;\u5730\u5740  \u6307\u9488\u53d8\u91cf\\&#8221;&#xff0c;\u8bb2\u5230\\&#8221;\u6570\u7ec4\u540d  \u9996\u5143\u7d20\u5730\u5740\\&#8221;&#xff0c;\u518d\u5230\\&#8221;\u51fd\u6570\u6307\u9488\u3001\u56de\u8c03\u51fd\u6570\u3001\u7b14\u8bd5\u9898\\&#8221;&#xff0c;\u628a\u6307\u9488\u7684\u5e38\u89c4\u5185\u5bb9\u57fa\u672c\u8d70\u5b8c\u4e86\u3002\u4f46\u6709\u51e0\u4e2a\u5730\u65b9&amp;#xff0<\/p>\n","protected":false},"author":2,"featured_media":95146,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[10187,174,99,4853,427],"topic":[],"class_list":["post-95149","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-codingplan","tag-c","tag-java","tag-4853","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \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\/95149.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e2a\u4eba\u4e3b\u9875&#xff1a;GeekZHR\u00a0 \u00a0\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u4e92\u4e09 25\u7ea7\u673a\u5668\u4eba\u5de5\u7a0bN\u975e\u672c\u79d1\u751f\u5728\u8bfb&#xff0c;\u81ea\u5b66C\/C&#xff0c;\u5d4c\u5165\u5f0f\u8f6f\u786c\u4ef6\u7b49\u7b49ing \u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8bc4\u8bba\u533a\u4e92\u52a8\u4ea4\u6d41 \u5199\u5728\u524d\u9762&#xff1a;\u524d\u4e94\u8bb2&quot;\u7559\u7684\u5c3e\u5df4&quot;&#xff0c;\u90fd\u5728\u8fd9\u4e00\u7bc7\u8865\u4e0a \u524d\u4e94\u8bb2&#xff0c;\u6211\u4eec\u4e00\u8def\u4ece&quot;\u5730\u5740 \u6307\u9488\u53d8\u91cf&quot;&#xff0c;\u8bb2\u5230&quot;\u6570\u7ec4\u540d \u9996\u5143\u7d20\u5730\u5740&quot;&#xff0c;\u518d\u5230&quot;\u51fd\u6570\u6307\u9488\u3001\u56de\u8c03\u51fd\u6570\u3001\u7b14\u8bd5\u9898&quot;&#xff0c;\u628a\u6307\u9488\u7684\u5e38\u89c4\u5185\u5bb9\u57fa\u672c\u8d70\u5b8c\u4e86\u3002\u4f46\u6709\u51e0\u4e2a\u5730\u65b9&amp;#xff0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/95149.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-16T02:49:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260816024912-6a8125286f807.jpg\" \/>\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=\"8 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95149.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/95149.html\",\"name\":\"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-08-16T02:49:18+00:00\",\"dateModified\":\"2026-08-16T02:49:18+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/95149.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/95149.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/95149.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \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\/95149.html","og_locale":"zh_CN","og_type":"article","og_title":"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e2a\u4eba\u4e3b\u9875&#xff1a;GeekZHR\u00a0 \u00a0\u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u4e92\u4e09 25\u7ea7\u673a\u5668\u4eba\u5de5\u7a0bN\u975e\u672c\u79d1\u751f\u5728\u8bfb&#xff0c;\u81ea\u5b66C\/C&#xff0c;\u5d4c\u5165\u5f0f\u8f6f\u786c\u4ef6\u7b49\u7b49ing \u6b22\u8fce\u5404\u4f4d\u5927\u4f6c\u8bc4\u8bba\u533a\u4e92\u52a8\u4ea4\u6d41 \u5199\u5728\u524d\u9762&#xff1a;\u524d\u4e94\u8bb2\"\u7559\u7684\u5c3e\u5df4\"&#xff0c;\u90fd\u5728\u8fd9\u4e00\u7bc7\u8865\u4e0a \u524d\u4e94\u8bb2&#xff0c;\u6211\u4eec\u4e00\u8def\u4ece\"\u5730\u5740 \u6307\u9488\u53d8\u91cf\"&#xff0c;\u8bb2\u5230\"\u6570\u7ec4\u540d \u9996\u5143\u7d20\u5730\u5740\"&#xff0c;\u518d\u5230\"\u51fd\u6570\u6307\u9488\u3001\u56de\u8c03\u51fd\u6570\u3001\u7b14\u8bd5\u9898\"&#xff0c;\u628a\u6307\u9488\u7684\u5e38\u89c4\u5185\u5bb9\u57fa\u672c\u8d70\u5b8c\u4e86\u3002\u4f46\u6709\u51e0\u4e2a\u5730\u65b9&amp;#xff0","og_url":"https:\/\/www.wsisp.com\/helps\/95149.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-08-16T02:49:18+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/08\/20260816024912-6a8125286f807.jpg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"8 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/95149.html","url":"https:\/\/www.wsisp.com\/helps\/95149.html","name":"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-08-16T02:49:18+00:00","dateModified":"2026-08-16T02:49:18+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/95149.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/95149.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/95149.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"C\u8bed\u8a00\u6307\u9488\u8fdb\u9636\u8865\u51456\uff1a\u52a8\u6001\u5185\u5b58\u7ba1\u7406\u3001mem\u7cfb\u5217\u5185\u5b58\u51fd\u6570\u3001\u590d\u6742\u6307\u9488\u58f0\u660e\uff0c\u4e00\u6b21\u8865\u9f50\u6307\u9488\u7684\u201c\u4e09\u5927\u76f2\u533a\u201c"}]},{"@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\/95149","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=95149"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/95149\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/95146"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=95149"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=95149"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=95149"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=95149"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}