V Mon, 01 Feb 2016 11:15:40 +0000
Namal via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com>
napsáno:

> Sorry guys that I didn't express myself well. I also mixed some 
> stuff up. What I wanted to ask is this, in c++ this is valid
> 
>       int x = 3;
>       int y = 10;
>       int arr [x][y];
> 
> x,y are known at the compile time and arr is a static array. I 
> can't do that in D so what is the best way to declare an array of 
> that size?

You can do that:
immutable x = 3;
immutable y = 10;
int[y][x] arr;

Reply via email to