How to initialize an array like int[][]

zhang zxpmyth at yahoo.com.cn
Tue Dec 5 08:06:18 PST 2006


In dmd/html/d/ctod.html, I see this:
      int[2][3] b = [ [2,3], [6,5], [3,4] ]; 

However, when I put it into main(), I can't compile it using DMD 0.175 .
To compile it successfully, I must change it to:
     static int[2][3] b = [ [2,3], [6,5], [3,4] ];

But how this happens. Thans for any help!




More information about the Digitalmars-d-learn mailing list