how use * in D just like C++

liumao via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 26 22:36:56 PDT 2015


for example
     class A;
     {
         void doSomething() {}
     }

     A *a = cast(A *) new A;

     then I call a.doSomething(); my program "Segmentation fault"



how could it happened? and how i use it correctly?


3q, please tell me, 3q 3q 3q!!!!!


More information about the Digitalmars-d mailing list