Yes, thank you, I corrected that.

However, if this v is a member of a class, like



import std.stdio;
import std.conv;
import core.vararg;

struct S
  {
    void *v;
  }

class C
{


  S* sx = new S;

  void dothings()
  {
     string[] ss = ["1", "2", "4"];
     string[] *s;
     void *vv;

     s = &ss;
     vv = s;

     sx.v = vv;

  }

}


void main() {

     C c = new C;
     c.dothings();
     writeln("done");

     string[]* sh;
     sh = cast(string[]*)c.sx.v;
writeln(sh); // upto this, works, the same pointer as set in // c.dothings(), checked with write instructions

     string[] si = *sh;
     writeln(si);
}



and then casted back, then i notice that it does not work. Wondering why.

Reply via email to