How to I get pointer to an Array and cast to a void * and back ?

2021-06-24 Thread seany via Digitalmars-d-learn
I have a struct : struct a { int i; // some more stuff ... } In a Class, I define public global `void * dataSet; ` In a function `f`, of the same class: i call : void f() { a[] rd_flattened; a[] * rd; // DO SOME WORK HERE this.dataSet = &

Re: How to I get pointer to an Array and cast to a void * and back ?

2021-06-24 Thread Dennis via Digitalmars-d-learn
On Thursday, 24 June 2021 at 14:06:11 UTC, seany wrote: void f() { a[] * rd; // DO SOME WORK HERE this.dataSet = & rd_flattened; rd = cast (a [] *) dataSet; write("length of rd is : "); writeln((*rd).length); // <--- this works.. // do some work on