2014-11-25 103 views
0

我已經做了一維數組並沒有什麼問題,但我究竟錯在這裏做二維數組?
不能看我要去哪裏錯了,它必須被格式化,但不能只見樹木不見森林!正在初始化一個二維數組

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" 
     } 
     }; 
    } 
    } 
} 

回答

0

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

優秀的末尾刪除分號!感謝Rad1,我早上不是一個好的首發, – StevieB 2014-11-25 07:50:36

+0

@StevieB,如果這能解決您的問題,如果您能夠投票並將其標記爲公認的答案,那將是非常好的。 – DB5 2014-11-25 08:14:53

+0

標記爲答覆,無法+投票,因爲沒有足夠的聲譽,但我希望我在最後得到良好的聲譽! ;) – StevieB 2014-11-25 08:18:14