[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: C++ help, please...
From:       Thomas Zander <zander () kde ! org>
Date:       2006-05-30 12:56:08
Message-ID: 200605301456.08516.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Tuesday 30 May 2006 14:34, Tomas Mecir wrote:
> int main() {
>   C *c = new C;
>   A *a = dynamic_cast<A*>(c);
>   B *b = dynamic_cast<B*>(a);
>   cout << ((b != 0) ? "b is not NULL" : "b is NULL") << endl;
>   return 0;
> }

This worked here as well; hence my confusion.

If you, however; pass 'a' to another class (in another file) and _there_ 
cast it to B it will fail. Apparently C++ does more compile time then it 
should.

-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic