数组的四种创建方法

2018-01-12 21:16:35来源:cnblogs.com作者:爱学习1234人点击

分享

第一种:

string[] myArray = new string[10];

for(int i = 0; i<10;i++){

  myArray[i] = i+1;

}

第二种:

string[] myArray2 = {"1","2","3","4","5","6","7","8","9","10"};

第三种:

string[] myArray = new string[10]{"1","2","3","4","5","6","7","8","9","10"};

第四种:

string[] myArray = new string[]{"1","2","3","4","5","6","7","8","9","10"};

最新文章

123

最新摄影

闪念基因

微信扫一扫

第七城市微信公众平台