【C#】数组_其他写法(19)
//知道数组内容
//初始化+赋值
string[] array01 = new string[2]{"a","b"};
----------------------------------------------------
//知道数组内容
float[]temp = new float[3];
temp[0]=1;
temp[1]=3;
temp[2]=7;
float max = GetMax(temp);
----------------------------------------------------
float[]temp = new float[3]{1,3,7};
float max = GetMax(temp);
----------------------------------------------------
float[]temp = {1,3,7};
float max = GetMax(temp);
----------------------------------------------------
float max = GetMax(new float[3]{1,3,7});
----------------------------------------------------
//初始化+赋值
bool[] array02;
array02 = new bool[3]{true,false,false};
//声明+初始化+赋值
bool[] array02 = {true,false,false};

浙公网安备 33010602011771号