How to init immutable static array?

Miguel L via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 18 00:20:48 PDT 2017


Hi, I need help again. I have an immutable static array and i 
need to initialize its contents inside a for loop. Something like 
this:

void f(int n)(....)
{
immutable float[n] my_array;
for(int i=0;i<n;++i)
   my_array[n]=some calculations(based on constants and n)

...

}

What is the better way to achieve this?
Thanks in advance.


More information about the Digitalmars-d-learn mailing list