{"id":1065,"date":"2024-10-18T15:54:17","date_gmt":"2024-10-18T15:54:17","guid":{"rendered":"https:\/\/blue16.cn\/?p=1065"},"modified":"2024-10-18T16:46:18","modified_gmt":"2024-10-18T16:46:18","slug":"c%e8%af%ad%e8%a8%80%e4%b8%ad%e7%9a%84%e5%87%bd%e6%95%b0","status":"publish","type":"post","link":"https:\/\/blue16.cn\/index.php\/2024\/10\/18\/1065\/","title":{"rendered":"C\u8bed\u8a00\u4e2d\u7684\u51fd\u6570"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u5f62\u5f0f\u53c2\u6570&amp;\u5b9e\u9645\u53c2\u6570<\/h3>\n\n\n\n<p>\u5f62\u5f0f\u53c2\u6570\u548c\u5b9e\u9645\u53c2\u6570\u4e4b\u95f4\u7684\u533a\u522b\u5728\u4e8e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5f62\u5f0f\u53c2\u6570\u662f\u51fd\u6570\u5b9a\u4e49\u7684\u4e00\u90e8\u5206\uff0c\u5b83\u4eec\u662f\u51fd\u6570\u671f\u671b\u63a5\u6536\u7684\u503c\u7684<strong>\u5360\u4f4d\u7b26<\/strong>\u3002<\/li>\n\n\n\n<li>\u5b9e\u9645\u53c2\u6570\u662f\u5728\u51fd\u6570\u8c03\u7528\u65f6<strong>\u5b9e\u9645\u4f20\u9012<\/strong>\u7ed9\u51fd\u6570\u7684\u503c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5728\u51fd\u6570\u8c03\u7528\u65f6\uff0c\u5b9e\u9645\u53c2\u6570\u7684\u503c\u4f1a\u88ab\u590d\u5236\u7ed9\u5f62\u5f0f\u53c2\u6570\uff0c\u8fd9\u6837\u51fd\u6570\u5c31\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e9b\u503c\u6765\u6267\u884c\u5176\u4efb\u52a1\u3002\u5728\u67d0\u4e9b\u7f16\u7a0b\u8bed\u8a00\u4e2d\uff08\u5982C\u8bed\u8a00\uff09\uff0c\u8fd9\u79cd\u4f20\u9012\u88ab\u79f0\u4e3a\u201c\u503c\u4f20\u9012\u201d\uff08pass by value\uff09\uff0c\u800c\u5728\u5176\u4ed6\u8bed\u8a00\u4e2d\uff0c\u53ef\u80fd\u652f\u6301\u201c\u5f15\u7528\u4f20\u9012\u201d\uff08pass by reference\uff09\uff0c\u5176\u4e2d\u5f62\u5f0f\u53c2\u6570\u662f\u5b9e\u9645\u53c2\u6570\u7684\u5f15\u7528\u6216\u6307\u9488\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;stdio.h&gt;\n\n\/\/ \u5b9a\u4e49add\u51fd\u6570\uff0ca\u548cb\u662f\u5f62\u5f0f\u53c2\u6570\nint add(int a, int b) {\n    return a + b;\n}\n\nint main() {\n    int x = 5;\n    int y = 3;\n    int result = add(x, y); \/\/ \u8c03\u7528add\u51fd\u6570\uff0cx\u548cy\u662f\u5b9e\u9645\u53c2\u6570\n    \/\/ printf(\"The result is: %dn\", result); \/\/ \u6253\u5370\u7ed3\u679c\n\n    return 0;\n}\n\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5c40\u90e8\u53d8\u91cf&amp;\u5168\u5c40\u53d8\u91cf<\/h3>\n\n\n\n<p>\u4f18\u5148\u987a\u5e8f\uff1a\u5c40\u90e8\u53d8\u91cf&gt;\u5168\u5c40\u53d8\u91cf<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u6570\u7ec4\u4f5c\u4e3a\u51fd\u6570\u53c2\u6570\u7684\u60c5\u51b5<\/h3>\n\n\n\n<p>\u628a\u6570\u7ec4\u4f5c\u4e3a\u53c2\u6570\u4f20\u9012\u7ed9\u51fd\u6570\u65f6\uff0c\u5b9e\u9645\u4e0a\u53ea\u6709\u6570\u7ec4\u7684\u9996\u5730\u5740\u4f5c\u4e3a\u6307\u9488\u4f20\u9012\u7ed9\u4e86\u51fd\u6570\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u5728\u51fd\u6570\u5b9a\u4e49\u4e2d\u7684int a[]\u7b49\u4ef7\u4e8eint *a\u3002\u5728\u53ea\u6709\u5730\u5740\u4fe1\u606f\u7684\u60c5\u51b5\u4e0b\uff0c\u662f\u65e0\u6cd5\u77e5\u9053\u6570\u7ec4\u91cc\u6709\u591a\u5c11\u4e2a\u5143\u7d20\u7684\u3002\u4ee5\u6570\u7ec4\u4e3a\u53c2\u6570\u8c03\u7528\u51fd\u6570\u65f6\uff0c\u5b9e\u9645\u4e0a\u53ea\u6709\u6570\u7ec4\u9996\u5730\u5740\u4f20\u9012\u7ed9\u4e86\u51fd\u6570\uff0c\u9700\u8981\u53e6\u52a0\u4e00\u4e2a\u53c2\u6570\u8868\u793a\u5143\u7d20\u4e2a\u6570\u3002\u9664\u4e86\u628a\u6570\u7ec4\u9996\u5730\u5740\u672c\u8eab\u4f5c\u4e3a\u5b9e\u53c2\u5916\uff0c\u8fd8\u53ef\u4ee5\u5229\u7528\u6307\u9488\u52a0\u51cf\u6cd5\u628a\u5176\u4ed6\u5143\u7d20\u7684\u9996\u5730\u5740\u4f20\u9012\u7ed9\u51fd\u6570\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5f62\u5f0f\u53c2\u6570&amp;\u5b9e\u9645\u53c2\u6570 \u5f62\u5f0f\u53c2\u6570\u548c\u5b9e\u9645\u53c2\u6570\u4e4b\u95f4\u7684\u533a\u522b\u5728\u4e8e\uff1a \u5728\u51fd\u6570\u8c03\u7528\u65f6\uff0c\u5b9e\u9645\u53c2\u6570\u7684\u503c\u4f1a\u88ab\u590d\u5236\u7ed9\u5f62\u5f0f\u53c2\u6570\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61,26,27],"tags":[],"class_list":["post-1065","post","type-post","status-publish","format-standard","hentry","category-c-c","category-study","category-study_note"],"_links":{"self":[{"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/posts\/1065","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1065"}],"version-history":[{"count":2,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/posts\/1065\/revisions"}],"predecessor-version":[{"id":1076,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/posts\/1065\/revisions\/1076"}],"wp:attachment":[{"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1065"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1065"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue16.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1065"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}