{"id":188458,"date":"2020-11-08T19:44:57","date_gmt":"2020-11-08T11:44:57","guid":{"rendered":"http:\/\/4563.org\/?p=188458"},"modified":"2020-11-08T19:44:57","modified_gmt":"2020-11-08T11:44:57","slug":"%e4%b8%ba%e4%bb%80%e4%b9%88-c-%e5%92%8c-java-%e5%a3%b0%e6%98%8e%e6%95%b0%e7%bb%84%e7%9a%84%e8%af%ad%e6%b3%95%e4%b8%8d%e5%90%8c%e6%9c%89%e4%bb%80%e4%b9%88%e6%95%85%e4%ba%8b%e5%90%97","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=188458","title":{"rendered":"\u4e3a\u4ec0\u4e48 C \u548c Java \u58f0\u660e\u6570\u7ec4\u7684\u8bed\u6cd5\u4e0d\u540c,\u6709\u4ec0\u4e48\u6545\u4e8b\u5417?"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u4e3a\u4ec0\u4e48 C \u548c Java \u58f0\u660e\u6570\u7ec4\u7684\u8bed\u6cd5\u4e0d\u540c,\u6709\u4ec0\u4e48\u6545\u4e8b\u5417?               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AndyAO <\/span>  <span><i><\/i> 7<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>public class CharArrayTest {     public static void main(String[] args) {         type[] arrayRefVar_0;   \/\/ \u9996\u9009\u7684\u65b9\u6cd5         type arrayRefVar_1[];  \/\/ \u6548\u679c\u76f8\u540c\uff0c\u4f46\u4e0d\u662f\u9996\u9009\u65b9\u6cd5     } }  <\/code><\/pre>\n<pre><code>type arrayName [ arraySize ]; <\/code><\/pre>\n<p>\u611f\u89c9 Java \u7684\u9996\u9009\u65b9\u6cd5\u66f4\u7b26\u5408\u6211\u7684\u76f4\u89c9.<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"4098072\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lonewolfakela <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             c \u8bed\u8a00\u7684\u6240\u6709\u7c7b\u578b\u58f0\u660e\u90fd\u9075\u5b88\u4e00\u4e2a\u57fa\u672c\u7684\u683c\u5f0f\uff1a\u4e00\u4e2a\u201c\u7c7b\u578b\u201d + \u4e00\u4e2a\u201c\u7528\u6cd5\u8303\u4f8b\u201d\uff0c\u6570\u7ec4\u4e5f\u4e0d\u4f8b\u5916<br \/>\u5c31\u4ee5\u6570\u7ec4\u58f0\u660e\u4e3a\u4f8b\u5b50\uff1a<br \/>int array[1000]<br \/>\u8fd9\u4e2a\u610f\u601d\u662f\u8bf4\uff0c\u5982\u679c\u6211\u4eec\u6309\u7167<br \/>array[\u6574\u6570]<br \/>\u8fd9\u6837\u7684\u683c\u5f0f\u5199\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a int \u578b\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u5982\u679c\u8bf4\u6570\u7ec4\u58f0\u660e\u5bf9\u8fd9\u4e2a\u683c\u5f0f\u7684\u4f53\u73b0\u8fd8\u4e0d\u592a\u660e\u663e\u7684\u8bdd\uff0c\u53ef\u4ee5\u770b\u770b\u51fd\u6570\u6307\u9488\u7684\u58f0\u660e\uff1a<br \/>int (*p) (int, int)<br \/>\u8fd9\u8868\u793a\uff0c\u5982\u679c\u6211\u4eec\u6309\u7167<br \/>(*p)(\u6574\u6570, \u6574\u6570)<br \/>\u8fd9\u6837\u7684\u683c\u5f0f\u5199\u4e00\u4e2a\u8868\u8fbe\u5f0f\uff0c\u5c31\u4f1a\u5f97\u5230\u4e00\u4e2a int \u578b\u7684\u7ed3\u679c\u3002<\/p>\n<p>\u6240\u4ee5\u603b\u7ed3\u4e0b\u6765\uff0cc \u8bed\u8a00\u58f0\u660e\u8bed\u53e5\u6700\u5de6\u4fa7\u5176\u5b9e\u662f\u5199\u7684\u201c\u8fd9\u4e2a\u53d8\u91cf\u5728\u6b63\u786e\u4f7f\u7528\u540e\u4f1a\u5f97\u5230\u4e00\u4e2a\u4ec0\u4e48\u7c7b\u578b\u7684\u7ed3\u679c\u201d\u800c\u4e0d\u662f\u201c\u8fd9\u4e2a\u53d8\u91cf\u672c\u8eab\u662f\u4ec0\u4e48\u7c7b\u578b\u201d\uff0c\u800c\u9664\u5f00\u6700\u5de6\u8fb9\u7684\u90a3\u4e2a\u7c7b\u578b\u4e4b\u5916\uff0c\u58f0\u660e\u7684\u53f3\u534a\u90e8\u5206\u5176\u5b9e\u662f\u5bf9\u88ab\u58f0\u660e\u53d8\u91cf\u7684\u4f7f\u7528\u65b9\u6cd5\u7684\u4e00\u4e2a\u793a\u4f8b\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098073\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : lonewolfakela <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u76f8\u6bd4\u4e4b\u4e0b\uff0ctype[] array \u8fd9\u79cd\u98ce\u683c\u7684\u58f0\u660e\u662f\u66f4\u76f4\u63a5\u7684\u4e00\u79cd\uff1a\u58f0\u660e\u7684\u5de6\u534a\u90e8\u5206\u662f\u201c\u88ab\u58f0\u660e\u53d8\u91cf\u672c\u8eab\u7684\u7c7b\u578b\u201d\uff0c\u53f3\u534a\u90e8\u5206\u662f\u201c\u88ab\u58f0\u660e\u53d8\u91cf\u7684\u540d\u5b57\u201d\u3002<br \/>\u8fd9\u79cd\u5199\u6cd5\u786e\u5b9e\u66f4\u7b26\u5408\u66f4\u591a\u4eba\u7684\u76f4\u89c9\uff08\u5bf9\u6570\u7ec4\u7c7b\u578b\u8fd8\u4e0d\u592a\u660e\u663e\uff0c\u4f46\u662f\u5982\u679c\u4f60\u5199\u4e00\u4e2a\u8fd4\u56de\u51fd\u6570\u6307\u9488\u7684\u51fd\u6570\u6307\u9488\u5c31\u80fd\u660e\u767d c \u8bed\u8a00\u7684\u90a3\u79cd\u98ce\u683c\u6709\u591a\u4e0d\u76f4\u89c2\u4e86\uff09\uff0c\u6240\u4ee5\u6bd4\u8f83\u65b0\u7684\u8bed\u8a00\u66f4\u591a\u5730\u90fd\u662f\u91c7\u7528 type[] array \u98ce\u683c\u7684\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098074\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : chihiro2014 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8ddf\u7f16\u8bd1\u539f\u7406\u6709\u5173                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098075\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : icyalala <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             Java:<br \/>int[] arrayName = new int[100];<\/p>\n<p>C:<br \/>int* arrayName = calloc(100, sizeof(int));<\/p>\n<p>\u8fd9\u6837\u5c31\u4e00\u6837\u4e86                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098076\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tairan2006 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             C \u7684\u6570\u7ec4\u5c31\u662f\u4e00\u4e2a\u6307\u9488                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098077\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : xiangyuecn <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             int array[100] \u773c\u775b\u544a\u8bc9\u5927\u8111\u662f 100 \u4e2a array\u274c<br \/>int[100] array \u773c\u775b\u544a\u8bc9\u5927\u8111\u662f 100 \u4e2a int\u2705<\/p>\n<p>\u8089\u773c\u53ef\u89c1\u7684\u4f2a\u4ee3\u7801                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098078\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : angryfish <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u770b\u770b cpo                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098079\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : angryfish <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             cpp                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"4098080\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : jin7 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             JAVA \u662f\u6700\u597d\u7684\u8bed\u8a00\u3002\u3002\u3002\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3a\u4ec0\u4e48 C \u548c Java \u58f0\u660e\u6570\u7ec4&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/188458"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=188458"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/188458\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=188458"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=188458"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=188458"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}