On 19/11/2016 10:46 PM, Marduk wrote:
In C one can do the following:# define N 10 double M[N][N]; In D I would like to achieve the same result. I tried with: mixin("int N = 10;"); double[N][N] M; but the compiler (DMD) complained with Error: variable N cannot be read at compile time. What am I doing wrong?
enum N = 10; double[N][N] M;enum is a constant available for use at compile time, your int there is a runtime variable not accessible at runtime.