string ss[100] = {"aa", "bb", "cc"};

解决方案 »

  1.   

    string[] ss = new string[100];string[] temp = new string[3]{"aa", "bb", "cc"};Array.Copy( temp,0,ss,0,3 );temp = null;
      

  2.   


     string ss[100] = {"aa", "bb", "cc"}; 
    ????????????????好像不能通过 C# 编译啊
      

  3.   

    莫非C#的编译器不支持如下写法:string[] ss = new string[100] {"aa", "bb", "cc"};还是有一种更好的写法???
      

  4.   

    这样当然通不过,根本没这种语法。实际上没有直接的方法,要么就一次初始化完,要么就一个个赋值。不过如果赋值较多的话,可以使用我给你的方法,初始化一个临时的数组,然后Copy进要复制的数组。
      

  5.   

    要么用Array.Copy函数,要么如下:
    string[] ss = new string[100];
    string[] temp = new string[3]{"aa", "bb", "cc"};
    for(int i=0;i<3;i++)
    {
    ss[i]=temp[i];
    }