Cast class reference to pointer of another class?

JN 666total at wp.pl
Sat May 29 21:03:12 UTC 2021


fixed formatting:

```d
struct Foo
{
}

class Bar
{
}

void main()
{
     Bar b = new Bar();
     Foo* f = cast(Foo*)b;
}
```




More information about the Digitalmars-d-learn mailing list