www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Why this has to be static?

reply Lord Syl <Lord_member pathlink.com> writes:
Hey, this...

int[][] array=[[0,1],[0,2],[0,3]];        /* failed! */
static int[][] array=[[0,1],[0,2],[0,3]]; /* OK */

Why it has to be static?. (In Java this doesn't happen, is something there I'm
missing?)
May 08 2004
parent "Vathix" <vathixSpamFix dprogramming.com> writes:
"Lord Syl" <Lord_member pathlink.com> wrote in message
news:c7iba7$kuh$1 digitaldaemon.com...
 Hey, this...

 int[][] array=[[0,1],[0,2],[0,3]];        /* failed! */
 static int[][] array=[[0,1],[0,2],[0,3]]; /* OK */

 Why it has to be static?. (In Java this doesn't happen, is something there
I'm
 missing?)
Not implemented yet, here's a workaround: const int[][] const_array = [[0, 1], [0, 2], [0, 3]]; int[][] array = const_array;
May 08 2004