Generate array of random values

Adam D. Ruppe destructionator at gmail.com
Mon Aug 1 12:46:42 PDT 2011


I'm barely following this thread, but why not:

===
import std.random;
void main() {
    int[] arr;
    foreach(i; 1 .. 100)
         arr ~= uniform(0, 1024);
}
===

?


More information about the Digitalmars-d-learn mailing list