初始化2d阵列

时间:2014-11-25 07:40:54

标签: arrays 2d

我已经完成了1d数组并且没有问题,但是我在这里使用2d数组做错了什么? 不知道我哪里出错了,一​​定是格式化但是看不到树林里的树林!

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Test_Matrix_Declared {
  class Program {
    static void Main(string[] args) {

      string[, ] TestLoads = new string[16, 8];

      //Enable, RQuies,   RSample, RWriteTx,   RDepass, RDischarge, DischargeDate, Discharge Time
      {
        {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "383", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "475000", "7560", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "475000", "7560", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }, {
          "1", "232000", "3770", "100000000", "191", "1180", "2009-04-03", "16:32:00"
        }
      };
    }
  }
}

1 个答案:

答案 0 :(得分:0)

末尾删除分号
string[,] TestLoads = new string[16,8];