Random Numbers

Ralph Main rmain1972 at live.com
Sat Aug 4 15:19:41 PDT 2012


On Saturday, 4 August 2012 at 20:22:23 UTC, Philippe Sigaud wrote:
> On Sat, Aug 4, 2012 at 7:27 PM, Ralph Main <rmain1972 at live.com> 
> wrote:
>
>> I tried the code in just main() like bearophile's post, and it 
>> worked just
>> fine.  I also removed the new keyword from my program and it 
>> compiled.
>>
>> The error message that I got yesterday with the example code 
>> returned an
>> error message that had something do with void and 0 arguments.
>
> In your previous code, did you put it in the module scope or in 
> a
> function? (main() is a function)

It was in the scope of a public function in a class.  I was 
experimenting with the D language.  Trying it out.  I like it, 
but there are some things that I don't like (but that is true of 
any programming language.)

class A {
private:
      //Code
public:
     int get_random() {
     //Code
     }
}


More information about the Digitalmars-d-learn mailing list