Passing a function (with arguments) as function input
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Sun Apr 22 21:21:30 PDT 2012
On 23/04/12 06:10, Ali Çehreli wrote:
> You just need to call the delegate with the function call syntax:
>
> writeln(rng());
... but what I get in my code is that printRandomNumbers then prints out n times
the _same number_, instead of 5 different ones. i.e. when the delegate is
passed its return value is clearly fixed and uniform() is not called multiple times.
More information about the Digitalmars-d-learn
mailing list