Generate array of random values

David Nadlinger see at klickverbot.at
Mon Aug 1 18:48:03 PDT 2011


On 8/2/11 3:40 AM, Jesse Phillips wrote:
> Andrej Mitrovic Wrote:
>> Is there a simpler way to do get an array of random values?
>
> Untested:
>
> auto arr = new int[1024];
> fill(arr, uniform(0, 1024));

This does a great job of creating an array containing the same random 
value 1024 times. ;)

David


More information about the Digitalmars-d-learn mailing list