This works also,

```

class C {
     int * pa;
     int [] a;
        // Constructor
        this() {writefln("Called constructor");
           pa=cast(int *)malloc(1000*int.sizeof);
           a=pa[0..1000];
          }

}

void dofun()
{
   scope x=new C;
   x.a[3]=5;
   writefln("%12x",&x);

}
int main(){
   dofun();
   dofun();
   return 0;

}

```
        • Re:... Alain De Vos via Digitalmars-d-learn
          • ... Steven Schveighoffer via Digitalmars-d-learn
        • Re:... Steven Schveighoffer via Digitalmars-d-learn
      • Re: How... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
        • Re:... Alain De Vos via Digitalmars-d-learn
          • ... drug007 via Digitalmars-d-learn
            • ... Alain De Vos via Digitalmars-d-learn
              • ... drug007 via Digitalmars-d-learn
            • ... Alain De Vos via Digitalmars-d-learn
  • Re: How to free ... Nick Treleaven via Digitalmars-d-learn
    • Re: How to ... Alain De Vos via Digitalmars-d-learn
      • Re: How... Ernesto Castellotti via Digitalmars-d-learn

Reply via email to