{"id":65951,"date":"2026-01-25T23:32:35","date_gmt":"2026-01-25T15:32:35","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/65951.html"},"modified":"2026-01-25T23:32:35","modified_gmt":"2026-01-25T15:32:35","slug":"day-15-%e6%8c%87%e9%92%88%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/65951.html","title":{"rendered":"day 15 \u6307\u9488+\u51fd\u6570"},"content":{"rendered":"<h3>\u4e00\u3001malloc \u7684\u57fa\u672c\u6982\u5ff5\u4e0e\u4f7f\u7528<\/h3>\n<p>malloc\u00a0\u662f C \u8bed\u8a00\u4e2d\u7528\u4e8e\u5728\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u7684\u51fd\u6570&#xff0c;\u5c5e\u4e8e\u00a0&lt;stdlib.h&gt;\u00a0\u6807\u51c6\u5e93\u3002\u5b83\u6839\u636e\u6307\u5b9a\u7684\u5927\u5c0f\u5206\u914d\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u8fd4\u56de\u6307\u5411\u8be5\u7a7a\u95f4\u9996\u5730\u5740\u7684\u6307\u9488\u3002\u82e5\u5206\u914d\u5931\u8d25&#xff0c;\u8fd4\u56de\u00a0NULL\u3002<\/p>\n<p>malloc&#xff1a;\u6570\u636e\u53ef\u4ee5\u5f00\u5728\u5806\u4e0a\u3002\u624b\u52a8\u7533\u8bf7&#xff0c;\u624b\u52a8\u91ca\u653e\u3002<\/p>\n<p>void* malloc(size_t size); \u00a0<\/p>\n<p>\u529f\u80fd&#xff1a;\u7533\u8bf7\u5806\u533a\u7a7a\u95f4 &#xff1b;\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u53c2\u6570&#xff1a;size&#xff1a;\u8868\u793a\u7533\u8bf7\u7684\u7a7a\u95f4\u5927\u5c0f&#xff0c;\u5355\u4f4d\u5b57\u8282&#xff1b;<\/p>\n<p>\u8fd4\u56de\u503c&#xff1a;void*\u00a0 \u8868\u793a\u7a7a\u7c7b\u578b\u6307\u9488\u3002<\/p>\n<p>void*\u00a0 \u00a0 \u4e07\u80fd\u6307\u9488&#xff1a;\u53ef\u4ee5\u63a5\u53d7\u4efb\u610f\u7c7b\u578b\u7684\u6307\u9488\u3002<\/p>\n<p>int a &#061; 10;<br \/>\nvoid *p &#061; &amp;a;<br \/>\nprintf&#xff08;&#034;&amp;d\\\\n&#034;&#xff0c;*p&#xff09;&#xff1b;  void\u8868\u793a\u7a7a\u7c7b\u578b\u5219\u6700\u7ec8\u4e0d\u77e5\u9053\u504f\u79fb\u591a\u5927\u4e00\u5757\u7a7a\u95f4<\/p>\n<p>printf&#xff08;&#034;&amp;d\\\\n&#034;&#xff0c;*&#xff08;int *&#xff09;p&#xff09;&#xff1b;<br \/>\n\u5982\u679c\u60f3\u901a\u8fc7void * \u7c7b\u578b\u7684\u6307\u9488\u5f15\u5f15\u7528\u5230\u6570\u636e\u5fc5\u987b,\u5f3a\u8f6c\u4e3a&#xff0c;\u4f60\u5e0c\u671b\u8bbf\u95ee\u7684\u6307\u9488\u7c7b\u578b <\/p>\n<p>void *calloc&#xff08;size_t nmemb&#xff0c;size_t size);\u00a0 \u00a0\/\/calloc&#xff08;10,sizeof&#xff08;int));<\/p>\n<p>void *realloc(void *ptr,size_t size);<\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\n#include &lt;string.h&gt;<br \/>\n#include &lt;stdlib.h&gt;<br \/>\nvoid getmemory(char** p, int num) {<br \/>\n    *p &#061; (char*)malloc(num);<br \/>\n}<br \/>\nint main() {<br \/>\n    char* str &#061; NULL;<\/p>\n<p>#str\u672c\u8eab\u662f\u4e00\u4e2a\u6307\u9488,\u5176\u503c\u4e3aNULL,\u8868\u793a\u5b83\u5f53\u524d\u4e0d\u6307\u5411\u4efb\u4f55\u6709\u6548\u7684\u5185\u5b58\u5730\u5740\u3002str \u5b58\u50a8\u7684\u662f\u5185\u5b58\u5730\u5740\u3002<br \/>\n#*str \u662f\u5bf9\u6307\u9488 str \u7684\u89e3\u5f15\u7528&#xff08;dereference&#xff09;&#xff0c;\u5373\u8bbf\u95ee str \u6240\u6307\u5411\u7684\u5185\u5b58\u4f4d\u7f6e\u7684\u503c\u3002<br \/>\n#\u4f46\u7531\u4e8estr\u88ab\u521d\u59cb\u5316\u4e3a NULL&#xff0c;\u89e3\u5f15\u7528 *str \u4f1a\u5bfc\u81f4\u672a\u5b9a\u4e49\u884c\u4e3a&#xff08;\u901a\u5e38\u662f\u7a0b\u5e8f\u5d29\u6e83&#xff0c;\u5982\u6bb5\u9519\u8bef&#xff09;\u3002<br \/>\n#str \u662f\u6307\u9488\u53d8\u91cf&#xff0c;\u5b58\u50a8\u5730\u5740\u3002<br \/>\n#*str \u662f\u89e3\u5f15\u7528\u64cd\u4f5c&#xff0c;\u8bbf\u95ee\u6307\u9488\u6307\u5411\u7684\u503c&#xff08;\u4f46\u9700\u6307\u9488\u6709\u6548&#xff09;\u3002<br \/>\n#&amp;str \u662f\u53d6\u6307\u9488\u53d8\u91cf str \u672c\u8eab\u7684\u5730\u5740&#xff0c;\u800c\u4e0d\u662f\u6307\u9488\u6307\u5411\u7684\u5185\u5bb9\u3002\u5373\u4f7fstr\u662fNULL&#xff0c;&amp;str\u4ecd\u7136\u662f\u5408\u6cd5\u7684#\u64cd\u4f5c&#xff0c;\u56e0\u4e3a\u5b83\u8fd4\u56de\u7684\u662f\u6307\u9488\u53d8\u91cf str \u5728\u5185\u5b58\u4e2d\u7684\u5730\u5740\u3002<\/p>\n<p>    getmemory(&amp;str, 100);<\/p>\n<p>#getmemory(str, 100); \u548c getmemory(&amp;str, 100); \u7684\u4e3b\u8981\u533a\u522b\u5728\u4e8e\u53c2\u6570\u4f20\u9012\u65b9\u5f0f&#xff1a;<br \/>\n#\u524d\u8005\u4f20\u9012\u6307\u9488\u7684\u503c&#xff08;\u4f20\u503c&#xff09;&#xff0c;\u540e\u8005\u4f20\u9012\u6307\u9488\u7684\u5730\u5740&#xff08;\u4f20\u5740&#xff09;\u3002<\/p>\n<p>    strcpy(str, &#034;hello&#034;);<br \/>\n    printf(&#034;%s&#034;, str);<br \/>\n    free(str);<br \/>\n    return 0;<br \/>\n} <\/p>\n<p><span style=\"color:#be191c\">\u6ce8\u610f&#xff1a;1.\u6307\u9488\u7c7b\u578b\u53ef\u4ee5\u4f5c\u4e3a\u56fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b2.\u4e0d\u80fd\u8fd4\u56de\u4e00\u4e2a\u5c40\u90e8\u53d8\u91cf&#xff08;\u6808\u4e0a&#xff09;\u7684\u5730\u5740&#8212;\u5df2\u7ecf\u662f\u4e00\u4e2a\u88ab\u9500\u6bc1\u4e86\u7684\u7a7a\u95f4\u3002<\/span><\/p>\n<h3><span style=\"color:#494949\">\u4e8c\u3001\u6307\u9488\u51fd\u6570\u53ca\u51fd\u6570\u6307\u9488<\/span><\/h3>\n<p><span style=\"color:#494949\">\u6307\u9488\u51fd\u6570&#xff08;\u8fd4\u56de\u503c\u4e3a\u6307\u9488\u7684\u51fd\u6570&#xff09;\u53ca\u51fd\u6570\u6307\u9488&#xff08;<\/span>\u6307\u5411\u51fd\u6570\u7684\u6307\u9488\u53d8\u91cf&#xff0c;\u5982<span style=\"color:#494949\">\u56de\u8c03\u51fd\u6570&#xff09;\u3002<\/span><\/p>\n<p>#\u6307\u9488\u51fd\u6570&#xff1a; \u8fd4\u56de\u7c7b\u578b* \u51fd\u6570\u540d(\u53c2\u6570\u5217\u8868);<br \/>\n#\u51fd\u6570\u6307\u9488&#xff1a;\u8fd4\u56de\u7c7b\u578b (*\u6307\u9488\u53d8\u91cf\u540d)(\u53c2\u6570\u5217\u8868);<\/p>\n<p><span style=\"color:#494949\">\u53ef\u4ee5\u83b7\u5f97\u51fd\u6570\u6240\u5728\u7a7a\u95f4\u7684\u5730\u5740\u51fd\u2014\u2014\u51fd\u6570\u540d\u5c31\u662f\u51fd\u6570\u7684\u5165\u53e3\u5730\u5740<\/span><\/p>\n<p><span style=\"color:#494949\">int add(int a,int b)<\/span><\/p>\n<p><span style=\"color:#494949\">{\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0}\/\/add\u51fd\u6570\u540d&#8212;\u5c31\u662f\u51fd\u6570\u7684\u5165\u53e3\u5730\u5740<\/span><\/p>\n<p><span style=\"color:#494949\">\u5b9a\u4e49\u4e2a\u4ec0\u4e48\u7c7b\u578b\u7684\u6307\u9488\u6765\u5b58\u653e\u8fd9\u79cd\u5730\u5740<\/span><\/p>\n<p><span style=\"color:#494949\">\u51fd\u6570\u4e5f\u662f\u6709\u7c7b\u578b\u2014\u2014\u51fd\u6570\u7c7b\u578b<\/span><\/p>\n<p><span style=\"color:#494949\">int add (int a&#xff0c;int b)&#xff1b;add\u540d\u5b57\u53bb\u6389 \u5269\u4e0b\u5c31\u662f\u51fd\u6570\u7c7b\u578b<\/span><\/p>\n<p><span style=\"color:#494949\">int&#xff08;int a,int b&#xff09;\/\/&#8212;\u8868\u793a\u8fd9\u4e48\u4e00\u7c7b\u51fd\u6570&#xff0c;\u8fd4\u56de\u503c\u4e3aint\u578b&#xff0c;\u540c\u65f6\u5e26\u6709\u4e24\u4e2aint\u578b\u5f62\u53c2<\/span><\/p>\n<p><span style=\"color:#494949\">int sum(int a,int b);<\/span><\/p>\n<p><span style=\"color:#494949\">float sub(float b,float b);<\/span><\/p>\n<p>#include &lt;stdio.h&gt;<br \/>\nint add(int a,int b)<br \/>\n{<br \/>\nreturn a&#043;b;<br \/>\n}<br \/>\nint main(void)<br \/>\n{<br \/>\nint (*p)(int,int) &#061; add;  \/\/\u51fd\u6570\u6307\u9488<br \/>\n    int&#xff08;*pf[4])(int,int&#xff09;&#061; {add,sub,mul,div}: \/\/\u6307\u9488\u51fd\u6570\u6570\u7ec4<br \/>\n    int i &#061;0;<br \/>\n    for(i &#061; 0; i &lt; 4; &#043;&#043;i)<br \/>\n    {<br \/>\n        processData(10,3,pf[i])&#xff1b;<br \/>\n    }<br \/>\nint ret &#061; p(1,2);<br \/>\nprintf(&#034;ret &#061; %d\\\\n&#034;,ret);<br \/>\nreturn 0;<br \/>\n}<\/p>\n<p>\u5730\u5740:\u6307\u9488\u53d8\u91cf<\/p>\n<p>int (int a,int b)\u00a0 \u00a0 *p&#xff1b;\/\/\u8fd9\u79cd\u51fd\u6570\u7c7b\u578b\u7684\u6307\u9488&#8211;\u7406\u89e3\u53ef\u4ee5&#xff0c;\u4f46\u662f\u4e0d\u80fd\u8fd9\u4e48\u5199<\/p>\n<p>int\u00a0 (*p)&#xff08;int a,int b&#xff09;&#xff1b;\/\/c\u8bed\u8a00\u6807\u51c6\u5199\u6cd5<\/p>\n<p>\u56de\u8c03\u51fd\u6570&#xff1a;\u901a\u8fc7\u51fd\u6570\u6307\u9488\u8fdb\u884c\u51fd\u6570\u8c03\u7528\u8fd9\u79cd\u5c31\u53eb\u56de\u8c03\u51fd\u6570&#xff0c;<\/p>\n<p>C\u8bed\u8a00\u662f\u901a\u8fc7\u51fd\u6570\u6307\u9488\u5b9e\u73b0\u56de\u8c03\u3002<\/p>\n<p>#include &lt;stdlib.h&gt;<br \/>\nvoid qsort( void *base,   \u6307\u5411\u8981\u5e26\u5e8f\u7684\u6570\u7ec4\u8d77\u59cb\u5730\u5740<br \/>\n            size_t nmemb, \u8981\u6392\u5e8f\u5143\u7d20\u4e2a\u6570<br \/>\n            size_t size,  \u5355\u4e2a\u5143\u7d20\u5927\u5c0f<br \/>\n            int(*compar)(const void *,const void *)  \u6bd4\u8f83\u89c4\u5219\u4e00\u4e2a\u51fd\u6570&#xff0c;\u51fd\u6570\u6307\u9488&#xff1b;<\/p>\n<p>intcompar&#xff08;constvoid*a&#xff0c;const void *b&#xff09;  a\u548cb\u5b9e\u9645\u4e0a\u662f\u6570\u7ec4\u4e2d\u67d0\u4e24\u4e2a\u5143\u7d20\u7684\u5730\u5740<br \/>\n{<br \/>\n    return *(int *)a &#8211; *(int *)b;<br \/>\n}<br \/>\n#include &lt;stdio.h&gt;<br \/>\n\/\/const char * *<br \/>\nint main(int argc, const char *argv[])<br \/>\n{<br \/>\nprintf(&#034;argc &#061; %d\\\\n&#034;,argc);<\/p>\n<p>int i &#061; 0;<br \/>\nwhile(argv[i] !&#061; NULL)<br \/>\n{<br \/>\nprintf(&#034;argv[%d] &#061; %s\\\\n&#034;,i,argv[i]);<br \/>\ni&#043;&#043;;<br \/>\n}<br \/>\nreturn 0;<br \/>\n} <\/p>\n<h3>\u4e09\u3001\u7ed3\u6784\u4f53<\/h3>\n<p>\u7ed3\u6784\u4f53&#xff08;struct&#xff09;\u662f\u4e00\u79cd\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u6570\u636e\u7c7b\u578b&#xff0c;\u7528\u4e8e\u5c06\u591a\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u53d8\u91cf\u7ec4\u5408\u6210\u4e00\u4e2a\u903b\u8f91\u5355\u5143\u3002\u9002\u7528\u4e8e\u9700\u8981\u5c06\u76f8\u5173\u8054\u7684\u6570\u636e\u805a\u5408\u7ba1\u7406\u7684\u573a\u666f&#xff08;\u5982\u5b66\u751f\u4fe1\u606f\u3001\u5750\u6807\u70b9\u7b49&#xff09;\u3002<\/p>\n<p>struct Student {<br \/>\n    char name[50];<br \/>\n    int age;<br \/>\n    float height;<br \/>\n}; <\/p>\n<p>\u544a\u8bc9\u7f16\u8bd1\u5668&#xff0c;\u6211\u5b9a\u4e49\u4e86\u4e00\u4e2a\u4eb2\u65b0\u7684\u6570\u636e\u7c7b\u578b \u2014\u2014 \u4ee3\u8868\u5b66\u751f\u6570\u636e\u7684-\u6570\u636e\u7c7b\u578b<\/p>\n<p>\u81ea\u5b9a\u4e49\u6570\u636e\u7c7b\u578b&#xff1a;<\/p>\n<\/p>\n<p>\u7c7b\u578b\u540d&#xff1a;struct\u00a0 student\u00a0 \u00a0 \u00a0\/\/\u7b49\u4ef7int ,short,float\u7b49\u3002<\/p>\n<p>\u7ed3\u6784\u4f53\u7684\u5927\u5c0f&#xff1a;<\/p>\n<p>\u5185\u5b58\u5bf9\u9f50&#xff1a;\u4e3a\u4e86\u63d0\u9ad8\u6548\u738732\u4f4d\u5c06\u6570\u636e\u5c3d\u53ef\u80fd\u653e\u5230\u80fd\u88ab4\u5b57\u8282\u6574\u9664\u7684\u5730\u5740\u7f16\u53f7\u4e0a\u3002<\/p>\n<p>\u7ed3\u6784\u4f53\u5bf9\u9f50\u7684\u89c4\u5219&#xff1a;1.\u7ed3\u6784\u4f53\u6210\u5458\u7684\u5bf9\u9f50&#xff1b;\u8981\u5728\u81ea\u7136\u8fb9\u754c\u5bf9\u9f50<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a02.\u6574\u4e2a\u7ed3\u6784\u4f53\u6700\u5927\u7684\u6210\u5458\u5bf9\u9f50<\/p>\n<p>\u7ed3\u6784\u4f53\u7684\u58f0\u660e\u4e0e\u521d\u59cb\u5316&#xff1a;\u58f0\u660e\u7ed3\u6784\u4f53\u53d8\u91cf\u65f6\u53ef\u76f4\u63a5\u521d\u59cb\u5316<\/p>\n<p>\u7ed3\u6784\u4f53\u521d\u59cb\u5316&#xff1a;<\/p>\n<p>structstu s &#061;{\u6309\u7167\u6210\u5458\u53d8\u91cf\u7684\u7684\u987a\u5e8f,\u4f9d\u6b21\u521d\u59cb\u5316};<\/p>\n<p>\u65b9\u5f0f&#xff1a;\u6309\u7167\u6210\u5458\u53d8\u91cf\u672c\u8eab\u65b9\u5f0f\u521d\u59cb\u5316&#xff0c;\u521d\u59cb\u5316\u503c\u4e4b\u95f4\u4ee5\u9017\u53f7\u5206\u9694<\/p>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u7684\u5f15\u7528&#xff1a;\u8bbf\u95ee\u6570\u636e\u4e0d\u80fd\u8bbf\u95ee\u6574\u4e2a\u7ed3\u6784\u4f53&#xff0c;\u5fc5\u987b\u8bbf\u95ee\u5230\u5177\u4f53\u6210\u5458\u3002<\/p>\n<p>\u7ed3\u6784\u4f53\u53d8\u91cf\u540d&#xff0e;\u6210\u5458\u53d8\u91cf\u540d&#8212;&#8212;-\u8bbf\u95ee\u5230\u4e86\u5177\u4f53\u6210\u5458<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u3001malloc \u7684\u57fa\u672c\u6982\u5ff5\u4e0e\u4f7f\u7528<br \/>\nmalloc\u00a0\u662f C \u8bed\u8a00\u4e2d\u7528\u4e8e\u5728\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u7684\u51fd\u6570&#xff0c;\u5c5e\u4e8e\u00a0\u00a0\u6807\u51c6\u5e93\u3002\u5b83\u6839\u636e\u6307\u5b9a\u7684\u5927\u5c0f\u5206\u914d\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u8fd4\u56de\u6307\u5411\u8be5\u7a7a\u95f4\u9996\u5730\u5740\u7684\u6307\u9488\u3002\u82e5\u5206\u914d\u5931\u8d25&#xff0c;\u8fd4\u56de\u00a0NULL\u3002<br \/>\nmalloc&#xff1a;\u6570\u636e\u53ef\u4ee5\u5f00\u5728\u5806\u4e0a\u3002\u624b\u52a8\u7533\u8bf7&#xff0c;\u624b\u52a8\u91ca\u653e\u3002<br \/>\nvoid* malloc(size_t size); \u00a0<br \/>\n\u529f\u80fd&#xff1a;\u7533\u8bf7\u5806\u533a\u7a7a\u95f4 &#xff1b;\u00a0 \u00a0 \u00a0<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[174,190,427],"topic":[],"class_list":["post-65951","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-190","tag-427"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>day 15 \u6307\u9488+\u51fd\u6570 - \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\/65951.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"day 15 \u6307\u9488+\u51fd\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e00\u3001malloc \u7684\u57fa\u672c\u6982\u5ff5\u4e0e\u4f7f\u7528 malloc\u00a0\u662f C \u8bed\u8a00\u4e2d\u7528\u4e8e\u5728\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u7684\u51fd\u6570&#xff0c;\u5c5e\u4e8e\u00a0\u00a0\u6807\u51c6\u5e93\u3002\u5b83\u6839\u636e\u6307\u5b9a\u7684\u5927\u5c0f\u5206\u914d\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u8fd4\u56de\u6307\u5411\u8be5\u7a7a\u95f4\u9996\u5730\u5740\u7684\u6307\u9488\u3002\u82e5\u5206\u914d\u5931\u8d25&#xff0c;\u8fd4\u56de\u00a0NULL\u3002 malloc&#xff1a;\u6570\u636e\u53ef\u4ee5\u5f00\u5728\u5806\u4e0a\u3002\u624b\u52a8\u7533\u8bf7&#xff0c;\u624b\u52a8\u91ca\u653e\u3002 void* malloc(size_t size); \u00a0 \u529f\u80fd&#xff1a;\u7533\u8bf7\u5806\u533a\u7a7a\u95f4 &#xff1b;\u00a0 \u00a0 \u00a0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/65951.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-01-25T15:32:35+00:00\" \/>\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=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65951.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/65951.html\",\"name\":\"day 15 \u6307\u9488+\u51fd\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-01-25T15:32:35+00:00\",\"dateModified\":\"2026-01-25T15:32:35+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/65951.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/65951.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/65951.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"day 15 \u6307\u9488+\u51fd\u6570\"}]},{\"@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":"day 15 \u6307\u9488+\u51fd\u6570 - \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\/65951.html","og_locale":"zh_CN","og_type":"article","og_title":"day 15 \u6307\u9488+\u51fd\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e00\u3001malloc \u7684\u57fa\u672c\u6982\u5ff5\u4e0e\u4f7f\u7528 malloc\u00a0\u662f C \u8bed\u8a00\u4e2d\u7528\u4e8e\u5728\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u7684\u51fd\u6570&#xff0c;\u5c5e\u4e8e\u00a0\u00a0\u6807\u51c6\u5e93\u3002\u5b83\u6839\u636e\u6307\u5b9a\u7684\u5927\u5c0f\u5206\u914d\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\u7a7a\u95f4&#xff0c;\u5e76\u8fd4\u56de\u6307\u5411\u8be5\u7a7a\u95f4\u9996\u5730\u5740\u7684\u6307\u9488\u3002\u82e5\u5206\u914d\u5931\u8d25&#xff0c;\u8fd4\u56de\u00a0NULL\u3002 malloc&#xff1a;\u6570\u636e\u53ef\u4ee5\u5f00\u5728\u5806\u4e0a\u3002\u624b\u52a8\u7533\u8bf7&#xff0c;\u624b\u52a8\u91ca\u653e\u3002 void* malloc(size_t size); \u00a0 \u529f\u80fd&#xff1a;\u7533\u8bf7\u5806\u533a\u7a7a\u95f4 &#xff1b;\u00a0 \u00a0 \u00a0","og_url":"https:\/\/www.wsisp.com\/helps\/65951.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-01-25T15:32:35+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/65951.html","url":"https:\/\/www.wsisp.com\/helps\/65951.html","name":"day 15 \u6307\u9488+\u51fd\u6570 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-01-25T15:32:35+00:00","dateModified":"2026-01-25T15:32:35+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/65951.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/65951.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/65951.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"day 15 \u6307\u9488+\u51fd\u6570"}]},{"@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\/65951","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=65951"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/65951\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=65951"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=65951"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=65951"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=65951"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}