c#中如何返回2维数组
1个回答
展开全部
//这样定义就可以,2行3列的数组
string[,] fn = new string[2, 3];
//你可以这样给每个赋值
fn[0, 0] = "string 0-0";
fn[0, 1] = "string 0-1";
fn[0, 2] = "string 0-2";
fn[1, 0] = "string 1-0";
fn[1, 1] = "string 1-1";
fn[1, 2] = "string 1-2";
//这里可以取个值 看看
string m = fn[1, 1];
string[,] fn = new string[2, 3];
//你可以这样给每个赋值
fn[0, 0] = "string 0-0";
fn[0, 1] = "string 0-1";
fn[0, 2] = "string 0-2";
fn[1, 0] = "string 1-0";
fn[1, 1] = "string 1-1";
fn[1, 2] = "string 1-2";
//这里可以取个值 看看
string m = fn[1, 1];
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询