{"id":336,"date":"2023-09-16T10:32:08","date_gmt":"2023-09-16T02:32:08","guid":{"rendered":""},"modified":"2023-09-18T11:49:45","modified_gmt":"2023-09-18T03:49:45","slug":"%e4%b8%80%e7%bb%b4%e6%95%b0%e7%bb%84%e5%88%9d%e5%a7%8b%e5%8c%96","status":"publish","type":"post","link":"https:\/\/mushiming.com\/336.html","title":{"rendered":"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316"},"content":{"rendered":"

\u6240\u8c13\u53d8\u91cf\u521d\u59cb\u5316\uff0c\u5c31\u662f\u5728\u5b9a\u4e49\u53d8\u91cf\u7684\u65f6\u5019\uff0c\u7ed9\u5176\u8d4b\u503c\u4e00\u4e2a\u521d\u59cb\u503c\u3002\u90a3\u4e48\uff0c\u6570\u7ec4\u521d\u59cb\u5316\uff0c\u5c31\u662f\u5728\u5b9a\u4e49\u6570\u7ec4\u7684\u65f6\u5019\uff0c\u7ed9\u5176\u8d4b\u503c\u521d\u59cb\u503c\u3002<\/p>\n

\u6570\u7ec4\u521d\u59cb\u5316\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

\u6570\u636e\u7c7b\u578b  \u6570\u7ec4\u540d [\u5e38\u91cf\u503c] = {\u503c1, \u503c2, ..., \u503cN};<\/span><\/p>\n

\u6b64\u65f6\uff0c\u5728\u5b9a\u4e49\u6570\u7ec4\u7684\u65f6\u5019\uff0c\u6307\u5b9a\u4e86\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u7136\u540e\uff0c\u7ed9\u6570\u7ec4\u8d4b\u503c\u3002\u4f8b\u5982\uff1a<\/p>\n

int<\/span> array[3] = {100, 200, 300};<\/span><\/p>\n

\u5c31\u76f8\u5f53\u4e8e\uff1a<\/p>\n

array[0] = 100;<\/p>\n

array[1] = 200;<\/p>\n

array[2] = 300;<\/p>\n

\u7a0b\u5e8f\u6d4b\u8bd5\u4f8b\u5b50\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u7a0b\u5e8f\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u6ce8\u610f\uff0c\u5982\u679c\u6570\u7ec4\u7684\u957f\u5ea6\u6bd4\u8d4b\u503c\u5217\u8868\u4e2d\u7684\u5143\u7d20\u591a\uff0c\u5219\u8d4b\u503c\u5217\u8868\u8d4b\u7ed9\u6570\u7ec4\uff0c\u7136\u540e\uff0c\u591a\u51fa\u7684\u6570\u7ec4\u5143\u7d20\u81ea\u52a8\u8d4b0\u503c\u3002\u4f8b\u5982\uff1a<\/p>\n

int<\/span> array[6] = {100, 200, 300};<\/span> \/\/\u6570\u7ec4\u957f\u5ea6\u662f6\u4e2a\u5143\u7d20\uff0c\u4f46\u662f\uff0c\u521d\u59cb\u5316\u5217\u8868\u624d\u67093\u4e2a\u6570\u503c\u3002<\/span><\/p>\n

\u5c31\u76f8\u5f53\u4e8e\uff1a<\/p>\n

array[0] = 100;<\/p>\n

array[1] = 200;<\/p>\n

array[2] = 300;<\/p>\n

array[3] = 0;<\/p>\n

array[4] = 0;<\/p>\n

array[5] = 0;<\/p>\n

\u53ef\u4ee5\u770b\u5230\uff0c\u5b9a\u4e49\u6570\u7ec4\u7684\u957f\u5ea6\u662f6\u4e2a\u5143\u7d20\uff0c\u4f46\u662f\uff0c\u8d4b\u503c\u5217\u8868\u624d\u67093\u4e2a\u5143\u7d20\uff0c\u6240\u4ee5\uff0c\u8d4b\u503c\u5217\u8868\u8d4b\u7ed9\u5143\u7d20\uff0c\u7136\u540e\uff0c\u5269\u4e0b\u7684\u5143\u7d20\u81ea\u52a8\u8d4b0\u503c\u3002<\/p>\n

\u7a0b\u5e8f\u6d4b\u8bd5\u4f8b\u5b50\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u7a0b\u5e8f\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u6ce8\u610f\uff1a\u7ed9\u6570\u7ec4\u521d\u59cb\u5316\u7684\u65f6\u5019\uff0c\u53ef\u4ee5\u4e0d\u7528\u5b9a\u4e49\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u4f8b\u5982\uff1a<\/p>\n

\u6570\u636e\u7c7b\u578b  \u6570\u7ec4\u540d [] = {\u503c1, \u503c2, ..., \u503cN};<\/span><\/p>\n

\u6b64\u65f6\uff0c\u6570\u7ec4\u7684\u957f\u5ea6\u5c31\u662f\u8d4b\u503c\u5217\u8868\u7684\u5143\u7d20\u4e2a\u6570\u3002\u4f8b\u5982\uff1a<\/p>\n

int<\/span> array[] = {100, 200 ,300};<\/span><\/p>\n

\u5b9a\u4e49array\u6570\u7ec4\u7684\u65f6\u5019\uff0c\u6ca1\u6709\u6307\u5b9a\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u90a3\u4e48\uff0c\u5c31\u76f8\u5f53\u4e8e\uff1a<\/p>\n

array[0] = 100<\/p>\n

array[1] = 200<\/p>\n

array[2] = 300<\/p>\n

\u6b64\u65f6\uff0c\u6570\u7ec4\u7684\u957f\u5ea6\u5c31\u662f\u8d4b\u503c\u5217\u8868\u7684\u5143\u7d20\u4e2a\u6570\u3002\u5b66\u4e60\u4e86sizeof\u5173\u952e\u5b57\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u4f7f\u7528sizeof\u5173\u952e\u5b57\u6765\u83b7\u53d6\u6570\u7ec4\u7684\u957f\u5ea6\uff0c\u7a0b\u5e8f\u6d4b\u8bd5\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u7a0b\u5e8f\u8fd0\u884c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

\"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316<\/p>\n

 <\/p>\n

\u53ef\u4ee5\u770b\u5230\uff0c\u5b9a\u4e49\u4e86 array \u6570\u7ec4\u7684\u957f\u5ea6\u662f3\uff0c\u5c31\u662f\u521d\u59cb\u5316\u5217\u8868{100, 200, 300}\u4e2d\u5143\u7d20\u7684\u4e2a\u6570\u3002<\/p>\n

\u97e6\u51ef\u5cf0 Linux C\/C++ \u7a0b\u5e8f\u8bbe\u8ba1\u6559\u7a0b\uff0cLinux \u7cfb\u7edf\u7f16\u7a0b\uff0cOpenwrt \u7cfb\u7edf\u5f00\u53d1\uff0c\u5fae\u4fe1:13926572996,QQ:1523520001,\u535a\u5ba2:www.mylinux.vip<\/p>\n","protected":false},"excerpt":{"rendered":"\u4e00\u7ef4\u6570\u7ec4\u521d\u59cb\u5316\u6240\u8c13\u53d8\u91cf\u521d\u59cb\u5316\uff0c\u5c31\u662f\u5728\u5b9a\u4e49\u53d8\u91cf\u7684\u65f6\u5019\uff0c\u7ed9\u5176\u8d4b\u503c\u4e00\u4e2a\u521d\u59cb\u503c\u3002\u90a3\u4e48\uff0c\u6570\u7ec4\u521d\u59cb\u5316\uff0c\u5c31\u662f\u5728\u5b9a\u4e49\u6570\u7ec4\u7684\u65f6\u5019\uff0c\u7ed9\u5176...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/336"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=336"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/336\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=336"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=336"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=336"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}