Cast class reference to pointer of another class?

JN 666total at wp.pl
Sat May 29 21:01:14 UTC 2021


```struct Foo
{
}

class Bar
{
}

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

this code compiles. Why? What is even the result in "f" in this 
case?


More information about the Digitalmars-d-learn mailing list