How do i cast A to object to class B when A can typcast to B?

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-03-21T11:26:42Z Indexed on 2010/03/21 11:31 UTC
Read the original article Hit count: 218

Basically i want to do this. ee causes a bad cast exception.
NOTE: o can be ANYTHING. It may not be B, it can be C, D, E, F etc.

        var b = (B)"sz";
        var e = (A)b;
        object o = b;
        var ee = (A)o;

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET